-
-
Notifications
You must be signed in to change notification settings - Fork 699
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Php72] Handle crash on PreInc usage on CreateFunctionToAnonymousFunc…
…tionRector (#2456) * [Php72] Handle crash on PreInc usage on CreateFunctionToAnonymousFunctionRector * Fixed 🎉 * phpstan * [ci-review] Rector Rectify Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
cb1473a
commit f2300ba
Showing
2 changed files
with
38 additions
and
10 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
...p72/Rector/FuncCall/CreateFunctionToAnonymousFunctionRector/Fixture/use_increment.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,37 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php72\Rector\FuncCall\CreateFunctionToAnonymousFunctionRector\Fixture; | ||
|
||
class UseIncrement | ||
{ | ||
private array $_quoteIdentifierCallbacks = array(); | ||
private int $_qiCallbacksCount = 0; | ||
|
||
public function getQuoteIdentifierCallback($adapter) | ||
{ | ||
$callback = create_function('$v', 'return Mage::helper(\'customgrid/collection\')->callQuoteIdentifier($v, '.++$this->_qiCallbacksCount.');'); | ||
} | ||
|
||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php72\Rector\FuncCall\CreateFunctionToAnonymousFunctionRector\Fixture; | ||
|
||
class UseIncrement | ||
{ | ||
private array $_quoteIdentifierCallbacks = array(); | ||
private int $_qiCallbacksCount = 0; | ||
|
||
public function getQuoteIdentifierCallback($adapter) | ||
{ | ||
$callback = function ($v) { | ||
return Mage::helper('customgrid/collection')->callQuoteIdentifier($v, ++$this->_qiCallbacksCount); | ||
}; | ||
} | ||
|
||
} | ||
|
||
?> |
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