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

False positive with namespace aliasing #51

Open
alamirault opened this issue Jan 6, 2024 · 0 comments
Open

False positive with namespace aliasing #51

alamirault opened this issue Jan 6, 2024 · 0 comments

Comments

@alamirault
Copy link

Hello,

Maybe somebody has an idea in order to avoid this false positive (found by https://github.com/symfony-tools/code-block-checker/blob/main/src/Service/CodeRunner/ClassExist.php)


https://github.com/symfony/symfony-docs/actions/runs/7431226718/job/20221747353?pr=19383

        // src/Entity/Author.php
        namespace App\Entity;

        use Symfony\Component\Validator\Constraints as Assert; # False positive here

        use Symfony\Component\Validator\Mapping\ClassMetadata;

        class Author
        {
            // ...

            public static function loadValidatorMetadata(ClassMetadata $metadata): void
            {
                $metadata->addPropertyConstraint('mac', new Assert\MacAddress());
            }
        }

[Missing class] Class, interface or trait with name "Symfony\Component\Validator\Constraints" does not exist

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

No branches or pull requests

1 participant