rectorphp / rector

Instant Upgrades and Automated Refactoring of any PHP 5.3+ code
https://getrector.com
MIT License
8.65k stars 680 forks source link

downgrade error on latest symfony 6 cache ItemInterface and ExpressionLanguageProvider #7001

Closed samsonasik closed 2 years ago

samsonasik commented 2 years ago

Bug Report

Subject Details
Rector version scope build

Minimal PHP Code Causing Issue

I am trying fix the rector build error on symfony 6 latest dependency at https://github.com/rectorphp/rector-src/pull/1812

It seems currently, for downgrading, there is part that not downgraded:


Parse error: rector-prefixed-downgraded/vendor/symfony/contracts/Cache/ItemInterface.php:51
    49|      * @throws CacheException           When the item comes from a pool that is not tag-aware
    50|      */
  > 51|     public function tag(string|iterable $tags) : static;
    52|     /**
    53|      * Returns a list of metadata info that were saved alongside with the cached value.
Unexpected '|', expecting variable (T_VARIABLE) in rector-prefixed-downgraded/vendor/symfony/contracts/Cache/ItemInterface.php on line 51
------------------------------------------------------------
Parse error: rector-prefixed-downgraded/vendor/symfony/dependency-injection/ExpressionLanguageProvider.php:25
    23| class ExpressionLanguageProvider implements \RectorPrefix20220214\Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface
    24| {
  > 25|     private ?\Closure $serviceCompiler;
    26|     public function __construct(callable $serviceCompiler = null)
    27|     {
Unexpected '?', expecting function (T_FUNCTION) or const (T_CONST) in rector-prefixed-downgraded/vendor/symfony/dependency-injection/ExpressionLanguageProvider.php on line 25
Error: Process completed with exit code 1.

Expected Behaviour

should be downgraded.

samsonasik commented 2 years ago

ref https://github.com/rectorphp/rector-src/runs/5177156068?check_suite_focus=true#step:14:82

samsonasik commented 2 years ago

resolved by https://github.com/rectorphp/rector-src/pull/1813 by skip both file as not used, and actualy, running manually appy the changes, so the downgrade process is not the issue, rather phpstan autoload.