-
-
Notifications
You must be signed in to change notification settings - Fork 165
Handle union and intersection types in App services autoloading #8367
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
base: 5.3
Are you sure you want to change the base?
Conversation
include_once __DIR__.'/../Fixtures/HttpKernel/AutowireSrc/src/Entity/FooEntity.php'; | ||
include_once __DIR__.'/../Fixtures/HttpKernel/AutowireSrc/src/EventListener/InvalidListener.php'; | ||
include_once __DIR__.'/../Fixtures/HttpKernel/AutowireSrc/src/EventListener/ValidListener.php'; | ||
include_once __DIR__.'/../Fixtures/HttpKernel/AutowireSrc/src/FrontendModule/LegacyModule.php'; | ||
include_once __DIR__.'/../Fixtures/HttpKernel/AutowireSrc/src/Messenger/UnionTypeMessage.php'; | ||
include_once __DIR__.'/../Fixtures/HttpKernel/AutowireSrc/src/Model/FooModel.php'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could omit all this if you used the correct namespaces for these files like we do in the core bundle:
contao/core-bundle/tests/Fixtures/Entity/Author.php
Lines 13 to 21 in 048082b
namespace Contao\CoreBundle\Tests\Fixtures\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
/** | |
* @ORM\Entity | |
* @ORM\Table(name="tl_author") | |
*/ | |
class Author |
Then you would not need an ignore-rule for the depcheck, either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That won't work, because we only load App services. Same as the test above for the AppBundle.
If you currently have a class in your App
/src/
folder, which has union or intersection types in the constructor, you get this error:Call to undefined method ReflectionUnionType::isBuiltin() in vendor/contao/manager-bundle/skeleton/config/services.php:93
This PR fixes the issue and adds unit tests for the
services.php
😎