question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem with PHPStan

See original GitHub issue

API Platform version(s) affected: 2.6.7

Description
After updating dependencies to last version, we get these errors in our PHPStan installation:

ParseError (syntax error, unexpected 'static' (T_STATIC)) thrown        
         while looking for class ApiPlatform\Core\Util\ClientTrait80.            
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols   

The PHPStan message isn’t very clear, so I’m not sure of what causes the issue as the code inside ClientTrait80 seems fine.

Or is it the static return type on the withOptions method that raises such an alarm?

We are running under PHP7.4

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:5

github_iconTop GitHub Comments

1reaction
ondrejmirtescommented, Jan 18, 2022

This is going to be fixed in PHPStan 1.4.2 which is going to be released soon.

1reaction
TristanPouliquencommented, Jan 17, 2022

Well spotted, I hadn’t found it! 😃 Closing the issue then

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · phpstan/phpstan - GitHub
PHP Static Analysis Tool - discover bugs in your code without running it! - Issues · phpstan/phpstan.
Read more >
Fix PHP Stan errors [#3310754] | Drupal.org
Problem/Motivation Used the PHPStan tool on level 0 and found 4 errors, need to fix them.
Read more >
php - Phpstan fails with "Syntax error, unexpected T_STRING ...
I have no idea what happened here, but the code is completely wrong. It's supposed to be an array definition, not a function....
Read more >
PHPStan: Find Bugs Without Writing Tests
PHPStan scans your whole codebase and looks for both obvious & tricky bugs. Even in those rarely executed if statements that certainly aren't...
Read more >
PHPStan | PhpStorm Documentation - JetBrains
To use PHPStan from PhpStorm instead of command line, ... every update in the file thus making it easy to get rid of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found