-
-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return nodes directly in MoneyFormatToNumberFormatRector (#3986)
- Loading branch information
1 parent
582af52
commit 1e0a1ce
Showing
3 changed files
with
75 additions
and
35 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
...s-tests/Php74/Rector/FuncCall/MoneyFormatToNumberFormatRector/Fixture/return_stmt.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,28 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php74\Rector\FuncCall\MoneyFormatToNumberFormatRector\Fixture; | ||
|
||
final class ReturnStmt | ||
{ | ||
public function run($value) | ||
{ | ||
return money_format('%i', $value); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php74\Rector\FuncCall\MoneyFormatToNumberFormatRector\Fixture; | ||
|
||
final class ReturnStmt | ||
{ | ||
public function run($value) | ||
{ | ||
$roundedValue = round($value, 2, PHP_ROUND_HALF_ODD); | ||
return number_format($roundedValue, 2, '.', ''); | ||
} | ||
} | ||
|
||
?> |
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
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