rectorphp / rector

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

Error on php 7.2 and php 7.3 with nette/utils 4.0 #8564

Closed samsonasik closed 7 months ago

samsonasik commented 7 months ago

Bug Report

Subject Details
Rector version e.g. dev-main (invoke vendor/bin/rector --version)

Minimal PHP Code Causing Issue

See e2e test on scoped rector/rector

https://github.com/rectorphp/rector/actions/runs/8334283973/job/22807579480#step:5:12

on commit https://github.com/rectorphp/rector/commit/b1eb18f499ca6ad1bd87c0c1613b24e38d579e6c

 [ERROR] Could not process                                                      
         "/home/runner/work/rector/rector/e2e/attributes/src/route.php" file,   
         due to:                                                                
         "System error: "preg_replace_callback() expects at most 5 parameters, 6
         given"                 

Expected Behaviour

should be working ok.

samsonasik commented 7 months ago

see https://3v4l.org/6cAT6#v7.3.33 , the error only on php 7.3

samsonasik commented 7 months ago

Ok, on php 7.2 is also error https://3v4l.org/6cAT6#v7.2.34

samsonasik commented 7 months ago

6th parameter seems exists on 546 https://github.com/rectorphp/rector/commit/b1eb18f499ca6ad1bd87c0c1613b24e38d579e6c#diff-ced2bc426fa45de5d56cfc0621cbe1c685706848056832365bc58dafef698393L469

samsonasik commented 7 months ago

Resolved by https://github.com/rectorphp/rector-src/pull/5738 and https://github.com/rectorphp/rector-src/pull/5739