Merge pull request #233 from carusogabriel/return-type

Add return type to anonymous function
This commit is contained in:
Tomáš Votruba 2017-12-26 22:38:43 +01:00 committed by GitHub
commit 8e19bcea56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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);
}