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

Add SQLFilter parameter in the configuration for Doctrine ORM #14

Closed
yoannch opened this issue Jan 24, 2012 · 22 comments
Closed

Add SQLFilter parameter in the configuration for Doctrine ORM #14

yoannch opened this issue Jan 24, 2012 · 22 comments
Labels

Comments

@yoannch
Copy link

yoannch commented Jan 24, 2012

Hello there,

In doctrine 2.2, a new feature was added : sql filters made by @asm89 => doctrine/orm#210.

But the doctrinebundle seems not to enable this in the configuration, so I'd like to add it.

Maybe we could add it as follow, in the config.yml :

doctrine:

    orm:
        filters:
            my_first_filter:
                class: 'Fully\Qualified\Class\Name'
                enabled: true
            my_second_filter:
                class: 'Fully\Qualified\Class\Name2'
                enabled: true

and so modify the Configuration and DoctrineExtension classes to enable this?

What do you think about this?

@armetiz
Copy link

armetiz commented Jan 30, 2012

Good proposition.
enabled booleanNode should have "true" as default value.

@beberlei
Copy link
Member

I think filters should be disabled by default, otherwise the proposition is good. You can implement this and send a PR.

Whats your take @asm89 ?

@Burgov
Copy link

Burgov commented Jan 30, 2012

exactly how could you force the filter to be abled using the container builder?

right now i'm trying this in a compiler pass, which i could port to this bundle once I get it working

        $container->getDefinition('doctrine.orm.default_configuration')
            ->addMethodCall('addFilter', array('filtername', 'classname'))
        ;
        $container->getDefinition('doctrine.orm.default_entity_manager')
            ->addMethodCall('getFilters', array())
            ->addMethodCall('enable', array('filtername'))
        ;

but that doesn't result in the desired code in the container class

        $instance->getFilters();
        $instance->enable('filtername');

rather than

        $instance->getFilters()->enable('filtername');

@asm89
Copy link
Member

asm89 commented Jan 30, 2012

Looks fine imo. I agree with @beberlei that filters should be disabled by default, because I think there are a lot of use cases where filters need additional parameters in order to work properly.

@yoannch
Copy link
Author

yoannch commented Jan 30, 2012

I agree with @beberlei and @asm89 : this boolean should have a false default value.

@Burgov I'm investigating right now on how to do that too, if you have any suggestions or ideas, feel free to mail me.

@Burgov
Copy link

Burgov commented Jan 31, 2012

I couldn't think of a way without changing Doctrine ORM code, for example a third optional boolean argument to addFilter, or an en-/disableFilter method on the entitymanager...

@stof
Copy link
Member

stof commented Jan 31, 2012

@Burgov I can look at it at the end of the week if you have issues implementing it

@Burgov
Copy link

Burgov commented Jan 31, 2012

@stof that'd be great. I'd write a PR if I knew how to do this. Unfortunately I'll be out of the country next week, so I won't be able to make any PR's soon

@yoannch
Copy link
Author

yoannch commented Feb 6, 2012

@stof did you have some time to explore this issues? I'm still blocking on the same issue as @Burgov ... if you have any tips, you're welcome!

@stof
Copy link
Member

stof commented Feb 6, 2012

I had no time at all for the Symfony2 community this weekend.

@yoannch
Copy link
Author

yoannch commented Feb 9, 2012

I found a solution! I implement it now, make tests and send you the PR as all tests will pass.

I just have a question about the configuration.

I first made a proposal as follow :

doctrine:
    ...
    orm:
        filters:
            my_first_filter:
                class: 'Fully\Qualified\Class\Name'
                enabled: true
            my_second_filter:
                class: 'Fully\Qualified\Class\Name2'
                enabled: true

I think that will work for the default entity manager, but if someone has different entity managers, he may want to have different filters for each of his entity managers right?

So I was thinking of the following conf :

doctrine:
    ...
    orm:
        filters:
            my_first_filter:
                class: 'Fully\Qualified\Class\Name'
                enabled: true
            my_second_filter:
                class: 'Fully\Qualified\Class\Name2'
                enabled: true
        entity_managers:
            em1:
                filters:
                    my_em1_filter:
                        class: 'Fully\Qualified\Class\Name'
                        enable: true
            em2:
                filters:
                    my_first_em2_filter:
                        class: 'Fully\Qualified\Class\Name'
                        enabled: true
                    my_scnd_em2_filter:
                        class: 'Fully\Qualified\Class\Name'
                        enabled: true

or do you think the following conf will be better :

doctrine:
    ...
    orm:
        entity_managers:
            default:
                filters:
                    my_first_filter:
                        class: 'Fully\Qualified\Class\Name'
                        enabled: true
                    my_second_filter:
                        class: 'Fully\Qualified\Class\Name2'
                        enabled: true
            em1:
                filters:
                    my_em1_filter:
                        class: 'Fully\Qualified\Class\Name'
                        enable: true
            em2:
                filters:
                    my_first_em2_filter:
                        class: 'Fully\Qualified\Class\Name'
                        enabled: true
                    my_scnd_em2_filter:
                        class: 'Fully\Qualified\Class\Name'
                        enabled: true

?

@stof
Copy link
Member

stof commented Feb 9, 2012

it should be done at the em level, like for DQL functions

@stof
Copy link
Member

stof commented Feb 9, 2012

so your last example (and the first one will correspond to the short syntax which is rewritten)

@yoannch
Copy link
Author

yoannch commented Feb 9, 2012

Ok, thanks for your advice. So I implement it to handle both the last example and the short syntax one (the first I gave).

@stof
Copy link
Member

stof commented Feb 9, 2012

No, you implement the last example and you add the needed key in the list of rewritten keys for the short syntax. Look at how it is handled

@stof
Copy link
Member

stof commented Feb 12, 2012

@beberlei @asm89 does it make sense to give the possibility to enable a sql filter through the config ? It would assume that the sql filter can work without any parameters.

@asm89
Copy link
Member

asm89 commented Feb 13, 2012

Yes. For example a SoftDeleteFilter could query for and <alias>.deleted = 0. There is no need to configure the parameters.

stof added a commit to stof/DoctrineBundle that referenced this issue Apr 1, 2012
@stof
Copy link
Member

stof commented Apr 1, 2012

I finally took some time (over my sleeping time obviously) to implement it

@Burgov
Copy link

Burgov commented Apr 2, 2012

Very nice! Need to remember these configurator classes, I can imagine it'll come in handy more often.

@stof stof closed this as completed Apr 2, 2012
@stof
Copy link
Member

stof commented Apr 2, 2012

@Burgov in most cases, they are overkill. The best way to see this is that I never saw a use case for them until yesterday

@julesbou
Copy link
Contributor

julesbou commented Apr 2, 2012

@stof Thanks for your time, for my part i've always had a big use case for this feature, restrict user_id on a multi-user product (SAAS).

@yoannch
Copy link
Author

yoannch commented Apr 10, 2012

@stof thank you very much for your time, I've been (and still am) overloaded theses weeks, and couldn't deal with it.

ostrolucky added a commit that referenced this issue Feb 20, 2024
Otherwise we get
```
Uncaught Exception: InvalidArgumentException Could not get class storage for doctrine\common\collections\selectable
Emitted in /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Provider/ClassLikeStorageProvider.php:45
Stack trace in the forked worker:
#0 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/ClassLikes.php(726): Psalm\Internal\Provider\ClassLikeStorageProvider->get()
#1 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/ClassLikes.php(716): Psalm\Internal\Codebase\ClassLikes->getParentInterfaces()
#2 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Codebase.php(763): Psalm\Internal\Codebase\ClassLikes->interfaceExtends()
#3 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Type/Comparator/ObjectComparator.php(357): Psalm\Codebase->interfaceExtends()
#4 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Type/Comparator/ObjectComparator.php(117): Psalm\Internal\Type\Comparator\ObjectComparator::isIntersectionShallowlyContainedBy()
#5 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Type/Comparator/AtomicTypeComparator.php(350): Psalm\Internal\Type\Comparator\ObjectComparator::isShallowlyContainedBy()
#6 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Type.php(891): Psalm\Internal\Type\Comparator\AtomicTypeComparator::isContainedBy()
#7 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Type.php(768): Psalm\Type::intersectAtomicTypes()
#8 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/PhpVisitor/Reflector/TypeHintResolver.php(112): Psalm\Type::intersectUnionTypes()
#9 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php(405): Psalm\Internal\PhpVisitor\Reflector\TypeHintResolver::resolve()
#10 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php(207): Psalm\Internal\PhpVisitor\Reflector\FunctionLikeNodeScanner->start()
#11 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(200): Psalm\Internal\PhpVisitor\ReflectorVisitor->enterNode()
#12 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(114): PhpParser\NodeTraverser->traverseArray()
#13 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(223): PhpParser\NodeTraverser->traverseNode()
#14 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(114): PhpParser\NodeTraverser->traverseArray()
#15 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(223): PhpParser\NodeTraverser->traverseNode()
#16 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(91): PhpParser\NodeTraverser->traverseArray()
#17 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Scanner/FileScanner.php(79): PhpParser\NodeTraverser->traverse()
#18 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(554): Psalm\Internal\Scanner\FileScanner->scan()
#19 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(782): Psalm\Internal\Codebase\Scanner->scanFile()
#20 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Fork/Pool.php(191): Psalm\Internal\Codebase\Scanner->scanAPath()
#21 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(332): Psalm\Internal\Fork\Pool->__construct()
#22 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(280): Psalm\Internal\Codebase\Scanner->scanFilePaths()
#23 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Codebase.php(505): Psalm\Internal\Codebase\Scanner->scanFiles()
#24 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php(510): Psalm\Codebase->scanFiles()
#25 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Cli/Psalm.php(374): Psalm\Internal\Analyzer\ProjectAnalyzer->check()
#26 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/psalm(9): Psalm\Internal\Cli\Psalm::run()
#27 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/bin/psalm(119): include('...')
#28 {main} in /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Fork/Pool.php:379
Stack trace:
#0 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Fork/Pool.php(413): Psalm\Internal\Fork\Pool->readResultsFromChildren()
#1 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(384): Psalm\Internal\Fork\Pool->wait()
#2 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(280): Psalm\Internal\Codebase\Scanner->scanFilePaths()
#3 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Codebase.php(505): Psalm\Internal\Codebase\Scanner->scanFiles()
#4 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php(510): Psalm\Codebase->scanFiles()
#5 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Cli/Psalm.php(374): Psalm\Internal\Analyzer\ProjectAnalyzer->check()
#6 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/psalm(9): Psalm\Internal\Cli\Psalm::run()
#7 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/bin/psalm(119): include('...')
#8 {main}
(Psalm 5.22.1@e9dad66e11274315dac27e08349c628c7d6a1a43 crashed due to an uncaught Throwable)
```
ostrolucky added a commit that referenced this issue Feb 20, 2024
Otherwise we get
```
Uncaught Exception: InvalidArgumentException Could not get class storage for doctrine\common\collections\selectable
Emitted in /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Provider/ClassLikeStorageProvider.php:45
Stack trace in the forked worker:
#0 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/ClassLikes.php(726): Psalm\Internal\Provider\ClassLikeStorageProvider->get()
#1 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/ClassLikes.php(716): Psalm\Internal\Codebase\ClassLikes->getParentInterfaces()
#2 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Codebase.php(763): Psalm\Internal\Codebase\ClassLikes->interfaceExtends()
#3 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Type/Comparator/ObjectComparator.php(357): Psalm\Codebase->interfaceExtends()
#4 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Type/Comparator/ObjectComparator.php(117): Psalm\Internal\Type\Comparator\ObjectComparator::isIntersectionShallowlyContainedBy()
#5 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Type/Comparator/AtomicTypeComparator.php(350): Psalm\Internal\Type\Comparator\ObjectComparator::isShallowlyContainedBy()
#6 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Type.php(891): Psalm\Internal\Type\Comparator\AtomicTypeComparator::isContainedBy()
#7 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Type.php(768): Psalm\Type::intersectAtomicTypes()
#8 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/PhpVisitor/Reflector/TypeHintResolver.php(112): Psalm\Type::intersectUnionTypes()
#9 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php(405): Psalm\Internal\PhpVisitor\Reflector\TypeHintResolver::resolve()
#10 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php(207): Psalm\Internal\PhpVisitor\Reflector\FunctionLikeNodeScanner->start()
#11 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(200): Psalm\Internal\PhpVisitor\ReflectorVisitor->enterNode()
#12 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(114): PhpParser\NodeTraverser->traverseArray()
#13 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(223): PhpParser\NodeTraverser->traverseNode()
#14 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(114): PhpParser\NodeTraverser->traverseArray()
#15 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(223): PhpParser\NodeTraverser->traverseNode()
#16 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(91): PhpParser\NodeTraverser->traverseArray()
#17 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Scanner/FileScanner.php(79): PhpParser\NodeTraverser->traverse()
#18 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(554): Psalm\Internal\Scanner\FileScanner->scan()
#19 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(782): Psalm\Internal\Codebase\Scanner->scanFile()
#20 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Fork/Pool.php(191): Psalm\Internal\Codebase\Scanner->scanAPath()
#21 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(332): Psalm\Internal\Fork\Pool->__construct()
#22 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(280): Psalm\Internal\Codebase\Scanner->scanFilePaths()
#23 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Codebase.php(505): Psalm\Internal\Codebase\Scanner->scanFiles()
#24 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php(510): Psalm\Codebase->scanFiles()
#25 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Cli/Psalm.php(374): Psalm\Internal\Analyzer\ProjectAnalyzer->check()
#26 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/psalm(9): Psalm\Internal\Cli\Psalm::run()
#27 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/bin/psalm(119): include('...')
#28 {main} in /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Fork/Pool.php:379
Stack trace:
#0 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Fork/Pool.php(413): Psalm\Internal\Fork\Pool->readResultsFromChildren()
#1 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(384): Psalm\Internal\Fork\Pool->wait()
#2 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(280): Psalm\Internal\Codebase\Scanner->scanFilePaths()
#3 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Codebase.php(505): Psalm\Internal\Codebase\Scanner->scanFiles()
#4 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php(510): Psalm\Codebase->scanFiles()
#5 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Cli/Psalm.php(374): Psalm\Internal\Analyzer\ProjectAnalyzer->check()
#6 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/psalm(9): Psalm\Internal\Cli\Psalm::run()
#7 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/bin/psalm(119): include('...')
#8 {main}
(Psalm 5.22.1@e9dad66e11274315dac27e08349c628c7d6a1a43 crashed due to an uncaught Throwable)
```
ostrolucky added a commit that referenced this issue Feb 20, 2024
Otherwise we get
```
Uncaught Exception: InvalidArgumentException Could not get class storage for doctrine\common\collections\selectable
Emitted in /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Provider/ClassLikeStorageProvider.php:45
Stack trace in the forked worker:
#0 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/ClassLikes.php(726): Psalm\Internal\Provider\ClassLikeStorageProvider->get()
#1 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/ClassLikes.php(716): Psalm\Internal\Codebase\ClassLikes->getParentInterfaces()
#2 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Codebase.php(763): Psalm\Internal\Codebase\ClassLikes->interfaceExtends()
#3 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Type/Comparator/ObjectComparator.php(357): Psalm\Codebase->interfaceExtends()
#4 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Type/Comparator/ObjectComparator.php(117): Psalm\Internal\Type\Comparator\ObjectComparator::isIntersectionShallowlyContainedBy()
#5 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Type/Comparator/AtomicTypeComparator.php(350): Psalm\Internal\Type\Comparator\ObjectComparator::isShallowlyContainedBy()
#6 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Type.php(891): Psalm\Internal\Type\Comparator\AtomicTypeComparator::isContainedBy()
#7 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Type.php(768): Psalm\Type::intersectAtomicTypes()
#8 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/PhpVisitor/Reflector/TypeHintResolver.php(112): Psalm\Type::intersectUnionTypes()
#9 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php(405): Psalm\Internal\PhpVisitor\Reflector\TypeHintResolver::resolve()
#10 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php(207): Psalm\Internal\PhpVisitor\Reflector\FunctionLikeNodeScanner->start()
#11 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(200): Psalm\Internal\PhpVisitor\ReflectorVisitor->enterNode()
#12 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(114): PhpParser\NodeTraverser->traverseArray()
#13 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(223): PhpParser\NodeTraverser->traverseNode()
#14 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(114): PhpParser\NodeTraverser->traverseArray()
#15 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(223): PhpParser\NodeTraverser->traverseNode()
#16 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(91): PhpParser\NodeTraverser->traverseArray()
#17 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Scanner/FileScanner.php(79): PhpParser\NodeTraverser->traverse()
#18 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(554): Psalm\Internal\Scanner\FileScanner->scan()
#19 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(782): Psalm\Internal\Codebase\Scanner->scanFile()
#20 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Fork/Pool.php(191): Psalm\Internal\Codebase\Scanner->scanAPath()
#21 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(332): Psalm\Internal\Fork\Pool->__construct()
#22 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(280): Psalm\Internal\Codebase\Scanner->scanFilePaths()
#23 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Codebase.php(505): Psalm\Internal\Codebase\Scanner->scanFiles()
#24 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php(510): Psalm\Codebase->scanFiles()
#25 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Cli/Psalm.php(374): Psalm\Internal\Analyzer\ProjectAnalyzer->check()
#26 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/psalm(9): Psalm\Internal\Cli\Psalm::run()
#27 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/bin/psalm(119): include('...')
#28 {main} in /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Fork/Pool.php:379
Stack trace:
#0 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Fork/Pool.php(413): Psalm\Internal\Fork\Pool->readResultsFromChildren()
#1 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(384): Psalm\Internal\Fork\Pool->wait()
#2 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(280): Psalm\Internal\Codebase\Scanner->scanFilePaths()
#3 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Codebase.php(505): Psalm\Internal\Codebase\Scanner->scanFiles()
#4 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php(510): Psalm\Codebase->scanFiles()
#5 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Cli/Psalm.php(374): Psalm\Internal\Analyzer\ProjectAnalyzer->check()
#6 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/psalm(9): Psalm\Internal\Cli\Psalm::run()
#7 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/bin/psalm(119): include('...')
#8 {main}
(Psalm 5.22.1@e9dad66e11274315dac27e08349c628c7d6a1a43 crashed due to an uncaught Throwable)
```
ostrolucky added a commit that referenced this issue Feb 20, 2024
Otherwise we get
```
Uncaught Exception: InvalidArgumentException Could not get class storage for doctrine\common\collections\selectable
Emitted in /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Provider/ClassLikeStorageProvider.php:45
Stack trace in the forked worker:
#0 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/ClassLikes.php(726): Psalm\Internal\Provider\ClassLikeStorageProvider->get()
#1 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/ClassLikes.php(716): Psalm\Internal\Codebase\ClassLikes->getParentInterfaces()
#2 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Codebase.php(763): Psalm\Internal\Codebase\ClassLikes->interfaceExtends()
#3 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Type/Comparator/ObjectComparator.php(357): Psalm\Codebase->interfaceExtends()
#4 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Type/Comparator/ObjectComparator.php(117): Psalm\Internal\Type\Comparator\ObjectComparator::isIntersectionShallowlyContainedBy()
#5 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Type/Comparator/AtomicTypeComparator.php(350): Psalm\Internal\Type\Comparator\ObjectComparator::isShallowlyContainedBy()
#6 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Type.php(891): Psalm\Internal\Type\Comparator\AtomicTypeComparator::isContainedBy()
#7 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Type.php(768): Psalm\Type::intersectAtomicTypes()
#8 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/PhpVisitor/Reflector/TypeHintResolver.php(112): Psalm\Type::intersectUnionTypes()
#9 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php(405): Psalm\Internal\PhpVisitor\Reflector\TypeHintResolver::resolve()
#10 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php(207): Psalm\Internal\PhpVisitor\Reflector\FunctionLikeNodeScanner->start()
#11 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(200): Psalm\Internal\PhpVisitor\ReflectorVisitor->enterNode()
#12 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(114): PhpParser\NodeTraverser->traverseArray()
#13 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(223): PhpParser\NodeTraverser->traverseNode()
#14 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(114): PhpParser\NodeTraverser->traverseArray()
#15 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(223): PhpParser\NodeTraverser->traverseNode()
#16 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(91): PhpParser\NodeTraverser->traverseArray()
#17 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Scanner/FileScanner.php(79): PhpParser\NodeTraverser->traverse()
#18 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(554): Psalm\Internal\Scanner\FileScanner->scan()
#19 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(782): Psalm\Internal\Codebase\Scanner->scanFile()
#20 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Fork/Pool.php(191): Psalm\Internal\Codebase\Scanner->scanAPath()
#21 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(332): Psalm\Internal\Fork\Pool->__construct()
#22 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(280): Psalm\Internal\Codebase\Scanner->scanFilePaths()
#23 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Codebase.php(505): Psalm\Internal\Codebase\Scanner->scanFiles()
#24 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php(510): Psalm\Codebase->scanFiles()
#25 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Cli/Psalm.php(374): Psalm\Internal\Analyzer\ProjectAnalyzer->check()
#26 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/psalm(9): Psalm\Internal\Cli\Psalm::run()
#27 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/bin/psalm(119): include('...')
#28 {main} in /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Fork/Pool.php:379
Stack trace:
#0 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Fork/Pool.php(413): Psalm\Internal\Fork\Pool->readResultsFromChildren()
#1 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(384): Psalm\Internal\Fork\Pool->wait()
#2 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(280): Psalm\Internal\Codebase\Scanner->scanFilePaths()
#3 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Codebase.php(505): Psalm\Internal\Codebase\Scanner->scanFiles()
#4 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php(510): Psalm\Codebase->scanFiles()
#5 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/src/Psalm/Internal/Cli/Psalm.php(374): Psalm\Internal\Analyzer\ProjectAnalyzer->check()
#6 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/vimeo/psalm/psalm(9): Psalm\Internal\Cli\Psalm::run()
#7 /home/runner/work/DoctrineBundle/DoctrineBundle/vendor/bin/psalm(119): include('...')
#8 {main}
(Psalm 5.22.1@e9dad66e11274315dac27e08349c628c7d6a1a43 crashed due to an uncaught Throwable)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants