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 a conflict for PhpStan 0.12.12 #1451

Merged
merged 1 commit into from Mar 2, 2020
Merged

Add a conflict for PhpStan 0.12.12 #1451

merged 1 commit into from Mar 2, 2020

Conversation

@leofeyer
Copy link
Member

leofeyer commented Mar 2, 2020

This will fix the CI tests so we can continue to merge issues. We will have to analyze the underlying problem at some point though.

@leofeyer leofeyer requested a review from contao/reviewers Mar 2, 2020
@leofeyer leofeyer self-assigned this Mar 2, 2020
@leofeyer leofeyer added the defect label Mar 2, 2020
@leofeyer leofeyer added this to the 4.10 milestone Mar 2, 2020
@leofeyer leofeyer added CI and removed defect labels Mar 2, 2020
@leofeyer leofeyer merged commit 6aba1ce into master Mar 2, 2020
9 checks passed
9 checks passed
Coverage
Details
Coding Style
Details
PHP 7.2
Details
PHP 7.3
Details
PHP 7.4
Details
Prefer Lowest
Details
Bundles
Details
Windows
Details
codecov/project 90.35% remains the same compared to eb1bb46
Details
@leofeyer leofeyer deleted the bugfix/phpstan branch Mar 2, 2020
@ondrejmirtes

This comment has been minimized.

Copy link

ondrejmirtes commented Mar 2, 2020

What's the problem with PHPStan?

@leofeyer

This comment has been minimized.

Copy link
Member Author

leofeyer commented Mar 2, 2020

Actually, we don't even know if it is a PhpStan problem. 😄 We are currently having a code sprint and we cannot merge issues with the CI pipeline failing, therefore we have added the conflict as intermediate solution so we do not have to spend time analyzing the actual problem.

This is the error message:

 ------ ---------------------------------------------------------------------- 
  Line   src/Controller/BackendCsvImportController.php                         
 ------ ---------------------------------------------------------------------- 
         Internal error: Warning: Use of undefined constant TL_MODE - assumed  
         'TL_MODE' (this will throw an Error in a future version of PHP)       
         Run PHPStan with --debug option and post the stack trace to:          
         https://github.com/phpstan/phpstan/issues/new                         
 ------ ---------------------------------------------------------------------- 

The code base defines the TL_MODE constant, however, the constant is not used in the BackendCsvImportController.php file. That is probably why the line number is empty. 🤷‍♂

@ondrejmirtes

This comment has been minimized.

Copy link

ondrejmirtes commented Mar 2, 2020

Interesting! You should add all constant definitions to a file and put it to parameters.bootstrap in your phpstan.neon. Otherwise PHPStan cannot see those constants.

@leofeyer

This comment has been minimized.

Copy link
Member Author

leofeyer commented Mar 2, 2020

What is also interesting is that the error does not occur on my local system when running PhpStan with the --debug flag. Could this be a cache problem?

@ondrejmirtes

This comment has been minimized.

Copy link

ondrejmirtes commented Mar 2, 2020

No idea. It would be best to find out where the constant is actually used.

@leofeyer

This comment has been minimized.

Copy link
Member Author

leofeyer commented Mar 2, 2020

Any idea why the issue does not occur in debug mode?

@ondrejmirtes

This comment has been minimized.

Copy link

ondrejmirtes commented Mar 2, 2020

It might do something with different order of analysed files thanks to the parallel mode.

Anyway, doesn't make sense to investigate it unless you follow my advice from #1451 (comment) - you're definitely missing this part and it might be just a coincidence that it sometimes works.

@leofeyer

This comment has been minimized.

Copy link
Member Author

leofeyer commented Mar 2, 2020

I followed your advice (see contao/phpstan@c1dafe0). I just wanted to understand why it suddenly stopped working. But "parallel mode" is already the answer to that. 😄

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

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.