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

Allow namespace import to be resolved #5123

Closed

Conversation

etshy
Copy link
Contributor

@etshy etshy commented Oct 5, 2023

fix rectorphp/rector#8224

I didn't run tests for rector/symfony rector\doctrine, etc. hope it won't break anything there.

Like discussed in the issue, I removed the class_exists check

/**
* @var float
*
* @FixtureAnnotation\CustomAnnotation()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems need a test with \ prefix for fqcn ensure for:

     * @\FixtureAnnotation\CustomAnnotation()

ensure that different namespace for FQCN?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand, is annotation starting with @\ exists ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, annotation work with @\ usage as FQCN

use Rector\Testing\TestingParser\TestingParser;
use Rector\Tests\CodingStyle\NodeAnalyzer\UseImportNameMatcher\Fixture\FixtureAnnotation\CustomAnnotation;

class UseImportNameMatcherTest extends AbstractLazyTestCase
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer real rules() usage instead of creating new test class, as it hard to debug, you can add more test with specific config under tests/Issues

https://github.com/rectorphp/rector-src/tree/main/tests/Issues

and add fixture with expected output with config there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure I'll need to see how to do what you ask.
I'll take a look to the otheres tests.

@samsonasik
Copy link
Member

Handled at #5287

@samsonasik samsonasik closed this Nov 25, 2023
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.

DoctrineAnnotationTagValueNode - resolved_class attribute is wrong with namespace use import without alias
2 participants