Skip to content

Conversation

@samsonasik
Copy link
Member

Given the following code :

return new class {
    /**
     * Run the migrations.
     *
     * @SuppressWarnings(PHPMD.ElseExpression)
     */
    public function up(): void
    {
        Schema::create('tagging_tagged', function (Blueprint $table) : void {
            $table->engine = 'InnoDB';
        });
    }
};

It currently produce error:

There was 1 error:

1) Rector\Tests\CodingStyle\Rector\Closure\StaticClosureRector\AutoImportTest::test with data set #0 (Symplify\SmartFileSystem\SmartFileInfo Object (...))
Undefined array key "AnonymousClass11f5dd862c2eabeab7ceede0c3d39eca"

/Users/samsonasik/www/rector-src/vendor/nette/utils/src/Utils/Reflection.php:311
/Users/samsonasik/www/rector-src/vendor/nette/utils/src/Utils/Reflection.php:279
/Users/samsonasik/www/rector-src/rules/CodingStyle/ClassNameImport/ShortNameResolver.php:232

Fixes rectorphp/rector#7398

@samsonasik
Copy link
Member Author

Fixed 🎉 /cc @Magiczne

@Magiczne
Copy link

Thanks a lot!

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@TomasVotruba TomasVotruba merged commit e155e52 into main Aug 20, 2022
@TomasVotruba TomasVotruba deleted the handle-crash-anonymous-class-auto-import branch August 20, 2022 09:46
@TomasVotruba
Copy link
Member

Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Could not process file with anonymous class and phpmd SupressWarnings annotation

5 participants