[BetterStandardPrinter] Using Expr_ArrowFunction->returnType with print return type double colon right after the bracket (#596)

This commit is contained in:
Abdul Malik Ikhsan 2021-08-05 12:38:58 +07:00 committed by GitHub
parent e4b356c117
commit 3eb503653f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

@ -28,7 +28,7 @@ final class SomeArrowFunction
{
public function action()
{
return fn() : \Rector\Tests\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromReturnNewRector\Source\SomeResponse => new SomeResponse();
return fn(): \Rector\Tests\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromReturnNewRector\Source\SomeResponse => new SomeResponse();
}
}

View File

@ -32,7 +32,7 @@ class App
function () {
fn() : \Rector\Tests\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedCallRector\Fixture\App => App::init();
fn(): \Rector\Tests\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedCallRector\Fixture\App => App::init();
};

View File

@ -84,6 +84,7 @@ final class BetterStandardPrinter extends Standard
$this->insertionMap['Stmt_ClassMethod->returnType'] = [')', false, ': ', null];
$this->insertionMap['Stmt_Function->returnType'] = [')', false, ': ', null];
$this->insertionMap['Expr_Closure->returnType'] = [')', false, ': ', null];
$this->insertionMap['Expr_ArrowFunction->returnType'] = [')', false, ': ', null];
}
/**