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
unreached code error after optimation with PHPCS #4370
Comments
This bug report is missing a link to reproduction on phpstan.org. It will most likely be closed after manual review. |
@mimmi20 After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-26: Parameter $lexer of method Browscap\Coverage\P::ignoreObjectBlock() has invalid typehint type Seld\JsonLint\Lexer.
+26: Parameter $lexer of method Browscap\Coverage\P::ignoreObjectBlock() has invalid type Seld\JsonLint\Lexer.
29: Call to method lex() on an unknown class Seld\JsonLint\Lexer.
39: Unreachable statement - code above always terminates. Full report
|
@mimmi20 After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-26: Parameter $lexer of method Browscap\Coverage\P::ignoreObjectBlock() has invalid typehint type Seld\JsonLint\Lexer.
+21: Constant Browscap\Coverage\P::JSON_OBJECT_END is unused.
+26: Parameter $lexer of method Browscap\Coverage\P::ignoreObjectBlock() has invalid type Seld\JsonLint\Lexer.
29: Call to method lex() on an unknown class Seld\JsonLint\Lexer.
39: Unreachable statement - code above always terminates. Full report
|
@mimmi20 After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-26: Parameter $lexer of method Browscap\Coverage\P::ignoreObjectBlock() has invalid typehint type Seld\JsonLint\Lexer.
+21: Constant Browscap\Coverage\P::JSON_OBJECT_END is unused.
+26: Parameter $lexer of method Browscap\Coverage\P::ignoreObjectBlock() has invalid type Seld\JsonLint\Lexer.
29: Call to method lex() on an unknown class Seld\JsonLint\Lexer.
39: Unreachable statement - code above always terminates. Full report
|
Fixed: phpstan/phpstan-src@d484ea8 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug report
We used
friendsofphp/php-cs-fixer
in our project and switching now todoctrine/coding-standard
. After the optimation of the code, I get an error.Code snippet that reproduces the problem
https://phpstan.org/r/4b5e90b0-8028-4772-a09e-98ab9de07d1a
code before the optimation which passes PHPStan
code after the optimation which failes PHPStan
I get the error in the optimized file:
the file phpstan.neon has the content:
the composer.json has the following content:
Expected output
no error
The text was updated successfully, but these errors were encountered: