Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TypeDeclaration] Fix abs() returns on ReturnTypeFromStrictTypedCallR…
…ector (#5652) * Create demo_file.php.inc with return type for abs function Function [abs](https://www.php.net/manual/en/function.abs.php) returns int or float (depends on input parameter). For PHP versions without support union return types this rule should only add return type into docBlock. * return * return * fix * fix * [ci-review] Rector Rectify --------- Co-authored-by: Pavel Kácha <kacha@shoptet.cz> Co-authored-by: GitHub Action <actions@github.com>
- Loading branch information
1 parent
290926c
commit 99a79f8
Showing
2 changed files
with
30 additions
and
4 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
...on/Rector/ClassMethod/ReturnTypeFromStrictTypedCallRector/FixturePhp80/abs_return.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedCallRector\Fixture; | ||
|
||
final class AbsReturn | ||
{ | ||
function aa($param) | ||
{ | ||
return abs($param); | ||
} | ||
} | ||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedCallRector\Fixture; | ||
|
||
final class AbsReturn | ||
{ | ||
function aa($param): int|float | ||
{ | ||
return abs($param); | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters