Skip to content

Commit

Permalink
[BetterStandardPrinter] Using Expr_ArrowFunction->returnType with pri…
Browse files Browse the repository at this point in the history
…nt return type double colon right after the bracket (#596)
  • Loading branch information
samsonasik committed Aug 5, 2021
1 parent e4b356c commit 3eb5036
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

};

Expand Down
1 change: 1 addition & 0 deletions src/PhpParser/Printer/BetterStandardPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public function __construct(
$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];
}

/**
Expand Down

0 comments on commit 3eb5036

Please sign in to comment.