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

Greatly simplify the PhpStan configuration #1948

Merged
merged 3 commits into from
Jul 21, 2020

Conversation

leofeyer
Copy link
Member

While trying to figure out #1940, I realized that we do not need contao/phpstan anymore in Contao 4.10.

@leofeyer leofeyer added the bug label Jul 20, 2020
@leofeyer leofeyer added this to the 4.10 milestone Jul 20, 2020
@leofeyer leofeyer requested review from bytehead and a team July 20, 2020 21:42
@leofeyer leofeyer self-assigned this Jul 20, 2020
@leofeyer
Copy link
Member Author

leofeyer commented Jul 20, 2020

Gotta figure out tomorrow where the app cache is built now. 😄

PHP Warning: file_get_contents(/home/runner/work/contao/contao/core-bundle/var/cache/phpstan/appContao_CoreBundle_Tests_Functional_app_AppKernelPhpstanDebugContainer.xml): failed to open stream: No such file or directory in /home/runner/work/contao/contao/vendor/phpstan/phpstan-symfony/src/Symfony/XmlServiceMapFactory.php on line 27
Warning: file_get_contents(/home/runner/work/contao/contao/core-bundle/var/cache/phpstan/appContao_CoreBundle_Tests_Functional_app_AppKernelPhpstanDebugContainer.xml): failed to open stream: No such file or directory in /home/runner/work/contao/contao/vendor/phpstan/phpstan-symfony/src/Symfony/XmlServiceMapFactory.php on line 27

@leofeyer
Copy link
Member Author

Hm, it even works fine without the phpstan/phpstan-symfony and psalm/plugin-symfony packages (see 8baf34f). @bytehead What am I missing here?

@Toflar
Copy link
Member

Toflar commented Jul 21, 2020

"it even works" === no errors but less checks ;-) symfony/phpstan-symfony checks for correct return types on certain stuff. See the README.

@bytehead
Copy link
Member

No errors could also mean not everything got tracked (afair). Otherwise it would not make sense for PHPStan to care about an additional extension for Symfony.

@bytehead
Copy link
Member

Same with

I realized that we do not need contao/phpstan anymore in Contao 4.10.

What's the exact reason for?

@leofeyer
Copy link
Member Author

Is there a way to make PhpStan/Psalm show the number of tests run?

@leofeyer
Copy link
Member Author

leofeyer commented Jul 21, 2020

I realized that we do not need contao/phpstan anymore in Contao 4.10.

What's the exact reason for?

The universalObjectCratesClasses option renders the BackendTemplateReflection class redundant and IIRC, the Symfony extension now understands all the *DynamicMethodReturnType* stuff natively.

Not 100% sure what the ServiceHelper class does, though. 🙈

@bytehead
Copy link
Member

I see, PHPStan got a lot better since our first steps with it 👍

@bytehead
Copy link
Member

May we have to add it again if we gain higher levels. Let's see. Apart from this LGTM.

@leofeyer leofeyer merged commit e06d9f6 into contao:master Jul 21, 2020
@leofeyer leofeyer deleted the fix/phpstan branch July 21, 2020 15:38
AlexejKossmann pushed a commit to AlexejKossmann/contao that referenced this pull request Apr 6, 2021
Description
-----------

While trying to figure out contao#1940, I realized that we do not need `contao/phpstan` anymore in Contao 4.10.

Commits
-------

ab5a4cf Greatly simplify the PhpStan configuration
8baf34f Remove the phpstan/phpstan-symfony and psalm/plugin-symfony packages
d70f85f Re-add the Symfony and Doctrine plugins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants