-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow PHPStan to match with @throws
phpdoc
#2095
Conversation
@throws
phpdoc@throws
phpdoc
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.
I do really much like this idea and I think this is the correct way forward. However, Guzzle still supports PHP5.5 so we cannot merge this PR until we drop support for PHP5
@Nyholm found out that as well, are there plans for Guzzle 7 on Any idea on how to cover Guzzle under PHPStan
Using the above as phpdoc won't solve the phpstan error either, so the only thing I can think of at the moment is to let PHPStan exclude it 馃憥 :
What about a polyfill? |
Adding this to
|
Note that PHP 5.5 is dead for 2 years already. PHP 5.6 and PHP 7.0 are security-only and will die at the end of this year. Supporting anything below 7.1 is basically non-sense from maintainer's PoV nowadays. You should migrate to fully typehinted PHP 7.1 code. 馃槉 (Let me know if I can help with this, did quite a lot of similar work on (not only) Doctrine projects.) |
That actually is an interesting one, as all Guzzle's |
Yes, that's correct, unfortunately using interfaces that don't extend Throwable was never supported and was merely a convention of some projects. This was also brought up in the PHPStan PR: phpstan/phpstan#1001 (comment) |
Ad legacy PHP, see: #2098 |
No, it's non-sense from a consumer point of view. From a maintainer point of view you have to consider the user base (you can't leave them alone), other elements of the roadmap, etc.
I fully agree, but for the reasons above we just can't do that yet. |
The user base won't be left alone. They will still have the 6.x version, don't they? You can still maintain that branch if you want... |
Not really true. As a maintainer, you have to maintain compatibility with a huge range of PHP versions. This itself makes things much more complex and greatly increases possibilities of bugs in some PHP versions. As said by @janedbal, releasing 7.0 with PHP 7.1 requirement does not mean leaving anyone alone, you still have 6.x with 5.5 support and bugfixes coming in. OTOH people stuck on dead PHP versions block whole ecosystem in past. |
I was arguing that statement out of context. As a maintainer the dropping PHP versions might/should not be the first thing to consider when thinking about a roadmap. |
If there would be a date when PSR 18 would get released, then that might be Guzzle 7's release goal? At least, based on #2098 (comment) I assume that would be a solid argument to define the future roadmap? As PSR 18 is still in draft, I don't see this happening within now and 2 years though. @Nyholm any plans on the Readiness vote? This all doesn't mean work can't get started on a |
Sorry, I just don't see any correlation between PSR release and Guzzle 7. Those are two totally different milestones... |
Does Drupal still rely on Guzzle? Are they still locked at PHP 5.5 or have they raised their minimum version requirement to 7+? |
How is that relevant? |
Psalm send me this error
|
Doesn't symfony have a polyfil that will allow this code on PHP 5? |
|
Oh, yeh, they only have |
PHPStan
0.10
was released last Weekend 馃帀 , and will throw the following exception starting from level 2:As all exceptions eventually extend
\RuntimeException
, and as we in userland want to rely on the interface, lettingGuzzleException
interface extend\Throwable
would be preferable.also see #1971