-
Notifications
You must be signed in to change notification settings - Fork 34
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
Fix ThemeCollector Symfony 7 compatibility #134
Fix ThemeCollector Symfony 7 compatibility #134
Conversation
@@ -60,7 +55,7 @@ public function getUsedTheme(): ?ThemeInterface | |||
} | |||
|
|||
/** | |||
* @return array|ThemeInterface[] | |||
* @return ThemeInterface[] |
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.
see phpdoc above
* | ||
* @psalm-suppress NonInvariantDocblockPropertyType | ||
*/ | ||
protected $data; |
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.
This variable is defined by DataCollector itself. With beginning of Symfony 7 it has a Union Type here: https://github.com/symfony/symfony/blob/1a16ebc32598faada074e0af12a6a698d2964a5e/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php#L31
For BC reasons best is to move this variable to PHPDoc definition. So we can support Symfony 7 and previous versions of the parent collector class.
"tests/Application/bin/console lint:container --env dev", | ||
"tests/Application/bin/console lint:container --env prod" |
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.
Stumbled now over that you also have a working console the lint:container would also catch such errors. I recommend always lint for dev and prod container as they may have different set of services.
Co-authored-by: Grzegorz Sadowski <[email protected]>
Thank you, Alexander! 🥇 |
I added a very simple test case which just init the ThemeCollector to catch this.