mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-25 20:23:49 +01:00
Merge pull request #233 from carusogabriel/return-type
Add return type to anonymous function
This commit is contained in:
commit
8e19bcea56
@ -57,7 +57,7 @@ final class BetterNodeFinder
|
||||
*/
|
||||
public function findFirstInstanceOfAny($nodes, array $types): ?Node
|
||||
{
|
||||
return $this->nodeFinder->findFirst($nodes, function (Node $node) use ($types) {
|
||||
return $this->nodeFinder->findFirst($nodes, function (Node $node) use ($types): bool {
|
||||
foreach ($types as $type) {
|
||||
if ($node instanceof $type) {
|
||||
return true;
|
||||
|
@ -167,7 +167,7 @@ final class AssertTrueFalseToSpecificMethodRector extends AbstractRector
|
||||
private function filterActiveOldToNewMethods(array $activeMethods = []): array
|
||||
{
|
||||
if ($activeMethods) {
|
||||
return array_filter($this->defaultOldToNewMethods, function (string $method) use ($activeMethods) {
|
||||
return array_filter($this->defaultOldToNewMethods, function (string $method) use ($activeMethods): bool {
|
||||
return in_array($method, $activeMethods, true);
|
||||
}, ARRAY_FILTER_USE_KEY);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user