Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rector-prefixed breaks use statements and triggers errors #2929

Closed
gnutix opened this issue Feb 25, 2020 · 5 comments
Closed

rector-prefixed breaks use statements and triggers errors #2929

gnutix opened this issue Feb 25, 2020 · 5 comments

Comments

@gnutix
Copy link
Contributor

gnutix commented Feb 25, 2020

Bug Report

Subject Details
Rector version since 1b052ca
Installed as prefixed Rector PHAR

It's been quite some time I haven't updated Rector on our project. Today I decided to do so and noticed some issues, so I went back in time (downloading previous versions of rector-prefixed's phar) until I had a working one. Here's the history :

  1. Updated Rector to commit d0a2b47 : works ! 👍
  2. Updated Rector to commit 1b052ca broken with [ERROR] The file "../utils" does not exist (in: phar:///app/rector.phar/src/HttpKernel/../../config)..
  3. Updated Rector to commit 6547a65 broken with Warning: require(phar:///app/rector.phar/vendor/composer/../../helpers/rector_dump_function.php): failed to open stream: phar error: "helpers/rector_dump_function.php" is not a file in phar "/app/rector.phar" in phar:///app/rector.phar/vendor/composer/autoload_real.php on line 57
  4. Updated Rector to commit 768b94d +
    Updated Rector to commit 02ac09f +
    Updated Rector to commit 0e46944 broken with [ERROR] The file "../utils" does not exist (in: phar:///app/rector.phar/src/HttpKernel/../../config).
  5. Updated Rector to commit 7e0bf17 and all versions up to HEAD broken with :
 [ERROR] Could not process "src/Some/File.php" file,   
         due to:                                                                                                        
         "Class '_HumbugBox551e43838180\JetBrains\PHPStormStub\PhpStormStubsMap' not found".                            

And all "use" statements are broken like this :

<?php
-use DataURI\Data;
-use DataURI\Dumper;
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Filesystem\Filesystem;
-use Webmozart\Assert\Assert;
-
+use Data;
+use Dumper;
+use TestCase;
+use Filesystem;
+use Assert;
  1. Updated Rector to commit HEAD also has the following extra error :
 [ERROR] Could not process "src/Some/File.php" file by                      
         "Rector\CodingStyle\Rector\ClassConst\VarConstantCommentRector", due to:                                       
         "Call to a member function changeVarType() on null".                                                           

Any idea what changes might have triggered all this ?

@gnutix gnutix changed the title rector-prefixed breaks use statements rector-prefixed breaks use statements and triggers errors Feb 25, 2020
@TomasVotruba
Copy link
Member

Failing CI would be much better 👍

@gnutix
Copy link
Contributor Author

gnutix commented Feb 25, 2020

Any idea what changes might have triggered all this ?

Means I have absolutely no idea what might be broken, nor why, so making CI fail is not undoable for me right now... I did the most I could, providing a "git bisect" equivalent on the commits.

@TomasVotruba
Copy link
Member

Closing as duplicated of #2879

@gnutix
Copy link
Contributor Author

gnutix commented Feb 25, 2020

This is not exactly a duplicate of #2879... There's two extra errors in here that are not listed in that issue :

  1. the broken use statements
  2. "Rector\CodingStyle\Rector\ClassConst\VarConstantCommentRector", due to "Call to a member function changeVarType() on null"

The first might be related to the stubs (maybe?), but I doubt the second would be.

@gnutix gnutix reopened this Feb 25, 2020
@TomasVotruba
Copy link
Member

Do not mix 2 issues at once. please re-open with new ones. Also, do not re-open issues, or I'll have to decrease your access. it's really frustrating to organize Rector issues with you doing it.

Demo link for this is needed.

@rectorphp rectorphp locked as resolved and limited conversation to collaborators Feb 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants