Skip to content

Commit

Permalink
refact(*): Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
EdenMl authored and bastien-phi committed Nov 24, 2023
1 parent c6d9abc commit b047055
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Rules/CarbonCopyRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ public function processNode(Node $node, Scope $scope): array
$scope,
$node->var,
'',
static fn (Type $type): bool => $type->canCallMethods()->yes() && $type->hasMethod($name)->yes()
static function (Type $type) use ($name): bool {
return $type->canCallMethods()->yes() && $type->hasMethod($name)->yes();
}
);

$type = $typeResult->getType();
Expand Down
4 changes: 3 additions & 1 deletion tests/RulesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ protected function findErrorsByLine(string $filename): array
{
$errors = $this->findErrors(realpath($filename));

return collect($errors['messages'] ?? [])->mapWithKeys(fn ($message) => [$message['line'] => $message['message']])->toArray();
return collect($errors['messages'] ?? [])->mapWithKeys(function ($message) {
return [$message['line'] => $message['message']];
})->toArray();
}
}

0 comments on commit b047055

Please sign in to comment.