mirror of
https://github.com/rectorphp/rector.git
synced 2025-04-19 06:52:51 +02:00
fix return type spacing on Closure
This commit is contained in:
parent
09932c2a44
commit
fb06c1fee1
@ -45,7 +45,7 @@ class CallableFalsePositive
|
||||
foreach ($callables as $key => $callable) {
|
||||
// 1. convert instant assign to callable
|
||||
if (!is_callable($callable)) {
|
||||
$populatedCallables[$key] = function () use ($callable) : string {
|
||||
$populatedCallables[$key] = function () use ($callable): string {
|
||||
return $callable;
|
||||
};
|
||||
continue;
|
||||
|
@ -22,7 +22,7 @@ class SomeClass
|
||||
{
|
||||
public function run($meetups)
|
||||
{
|
||||
return array_filter($meetups, function ($meetup) : bool {
|
||||
return array_filter($meetups, function ($meetup): bool {
|
||||
return is_object($meetup);
|
||||
});
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ class ReturnTypeObject
|
||||
{
|
||||
public function shouldSkip()
|
||||
{
|
||||
$nonAnonymousClassNodes = array_filter([], function (Class_ $classNode) : ?\PhpParser\Node\Identifier {
|
||||
$nonAnonymousClassNodes = array_filter([], function (Class_ $classNode): ?\PhpParser\Node\Identifier {
|
||||
return $classNode->name;
|
||||
});
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ class SubtypeOfObject
|
||||
{
|
||||
public function run($stmt)
|
||||
{
|
||||
$this->callableNodeTraverser->traverseNodesWithCallable([$stmt], function (Node $node) : \PhpParser\Node
|
||||
$this->callableNodeTraverser->traverseNodesWithCallable([$stmt], function (Node $node): \PhpParser\Node
|
||||
{
|
||||
if (!$node instanceof String_) {
|
||||
return $node;
|
||||
|
@ -29,6 +29,7 @@ final class BetterStandardPrinter extends Standard
|
||||
$this->initializeInsertionMap();
|
||||
$this->insertionMap['Stmt_ClassMethod->returnType'] = [')', false, ': ', null];
|
||||
$this->insertionMap['Stmt_Function->returnType'] = [')', false, ': ', null];
|
||||
$this->insertionMap['Expr_Closure->returnType'] = [')', false, ': ', null];
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user