Skip to content

Commit b5635d0

Browse files
committed
feature #16125 Replace is_callable checks with type hints (mpajunen, nicolas-grekas)
This PR was merged into the 3.0-dev branch. Discussion ---------- Replace is_callable checks with type hints | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #14330 | License | MIT | Doc PR | - Also removes tests checking the exceptions thrown from the removed is_callable checks. Commits ------- 7685cdd Add more callable type hints 4e0c6e1 Replace is_callable checks with type hints
2 parents 3233436 + 57539a7 commit b5635d0

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

Normalizer/AbstractNormalizer.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,9 @@ public function setCircularReferenceLimit($circularReferenceLimit)
8686
* @param callable $circularReferenceHandler
8787
*
8888
* @return self
89-
*
90-
* @throws InvalidArgumentException
9189
*/
92-
public function setCircularReferenceHandler($circularReferenceHandler)
90+
public function setCircularReferenceHandler(callable $circularReferenceHandler)
9391
{
94-
if (!is_callable($circularReferenceHandler)) {
95-
throw new InvalidArgumentException('The given circular reference handler is not callable.');
96-
}
97-
9892
$this->circularReferenceHandler = $circularReferenceHandler;
9993

10094
return $this;
@@ -103,7 +97,7 @@ public function setCircularReferenceHandler($circularReferenceHandler)
10397
/**
10498
* Set normalization callbacks.
10599
*
106-
* @param array $callbacks help normalize the result
100+
* @param callable[] $callbacks help normalize the result
107101
*
108102
* @return self
109103
*

0 commit comments

Comments
 (0)