[poc] Testing native ContaintsStmts interface#7509
[poc] Testing native ContaintsStmts interface#7509TomasVotruba wants to merge 3 commits intomainfrom
Conversation
samsonasik
left a comment
There was a problem hiding this comment.
Also, composer config:
"extra": {
// ...
"nikic/php-parser": [
],
}
except this line for caching purpose:
https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-nodetraverser-php.patch
can be removed.
|
For note: To actually use it, we need to wait for PHPStan new release that consume latest nikic/php-parser that include that feature, then we upping the phpstan/phpstan version. |
samsonasik
left a comment
There was a problem hiding this comment.
Also, in preload.php and preload-split-package.php or in bootstrap.php, we need BC break check:
class_alias(
\PhpParser\Node\ContainsStmts::class,
\Rector\Contract\PhpParser\Node\StmtsAwareInterface::class
);then remove the actual Rector\Contract\PhpParser\Node\StmtsAwareInterface class so user that already use it will keep it working :)
Then, create minor release that note user that the interface is deprecated.
There is no actual warning in getNodeTypes() in AbstractRector is not sub type of Node interface, so we only got silent skip operation right now.
|
This is just for testing 👍 |
|
These lines need to be removed Lines 119 to 133 in 110cbfa to make installation succeed. Then |
|
I am thinking that -interface StmtsAwareInterface extends Node
+/** @deprecated use \PhpParser\Node\ContaintsStmts instead */
+interface StmtsAwareInterface extends Node\ContaintsStmts |
|
@TomasVotruba I will move test error to https://github.com/rectorphp/rector-downgrade-php as related with downgrade rules so this can be green here :) Ref PRs: |
|
@TomasVotruba please rebase, unit tests should green now 👍 |
59576e4 to
1e31208
Compare
Make use of nikic/PHP-Parser#1113
testsandrules-tests