-
Notifications
You must be signed in to change notification settings - Fork 676
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
Update master from 5.x #10750
Merged
Merged
Update master from 5.x #10750
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List failed tests: ``` 1) Psalm\Tests\MagicMethodAnnotationTest::testNoSealAllMethodsWithStatic Failed asserting that exception of type "Psalm\Exception\CodeException" is thrown. 2) Psalm\Tests\MagicMethodAnnotationTest::testSealAllMethodsWithoutFooWithStatic Failed asserting that exception of type "Psalm\Exception\CodeException" is thrown. 3) Psalm\Tests\MagicMethodAnnotationTest::testInvalidCode with data set "inheritSealedMethodsWithStatic" Failed asserting that exception of type "Psalm\Exception\CodeException" is thrown. ```
Appended problem by that commit: ``` 1) FileReferenceTest::testReferencedMethods with data set "getClassReferences" Failed asserting that two arrays are identical. --- Expected +++ Actual @@ @@ 'foo\b::__construct' => true 'foo\c::foo' => true ) - 'foo\c::__construct' => Array &2 ( + 'foo\a::__callstatic' => Array &2 ( + 'foo\b::__construct' => true + ) + 'foo\c::__construct' => Array &3 ( 'foo\b::bar' => true ) ) ```
Resolved problem: ``` FileReferenceTest::testReferencedMethods with data set "getClassReferences" Failed asserting that two arrays are identical. --- Expected +++ Actual @@ @@ 'foo\b::__construct' => true 'foo\c::foo' => true ) - 'foo\c::__construct' => Array &2 ( + 'foo\a::__callstatic' => Array &2 ( + 'foo\b::__construct' => true + ) + 'foo\c::__construct' => Array &3 ( 'foo\b::bar' => true ) ) ```
The main task for deleting: ``` $method_id = new MethodIdentifier( $fq_class_name, '__callstatic', ); ``` List of resolved problems: ``` 1) Psalm\Tests\MagicMethodAnnotationTest::testNoSealAllMethodsWithStatic Failed asserting that exception of type "Psalm\Exception\CodeException" is thrown. 2) Psalm\Tests\MagicMethodAnnotationTest::testSealAllMethodsWithoutFooWithStatic Failed asserting that exception of type "Psalm\Exception\CodeException" is thrown. 3) Psalm\Tests\MagicMethodAnnotationTest::testInvalidCode with data set "inheritSealedMethodsWithStatic" Failed asserting that exception of type "Psalm\Exception\CodeException" is thrown. ``` Appended problem by that fix: ``` 1) MagicMethodAnnotationTest::testSealAllMethodsSetToFalseWithStatic Psalm\Exception\CodeException: UndefinedMagicMethod - somefile.php:8:15 - Magic method B::foo does not exist ```
Resolved problem: ``` 1) MagicMethodAnnotationTest::testSealAllMethodsSetToFalseWithStatic Psalm\Exception\CodeException: UndefinedMagicMethod - somefile.php:8:15 - Magic method B::foo does not exist ```
Failed test: ``` 1) MagicMethodAnnotationTest::testAnnotationWithoutCallConfigWithExtendsWithStatic Failed asserting that exception of type "Psalm\Exception\CodeException" is thrown. ```
Resolved error: ``` MagicMethodAnnotationTest::testAnnotationWithoutCallConfigWithExtendsWithStatic Failed asserting that exception of type "Psalm\Exception\CodeException" is thrown. ``` Appended problem: ``` MagicMethodAnnotationTest::testValidCode with data set "magicStaticMethodInheritanceWithoutCallStatic" Psalm\Exception\CodeException: UndefinedMethod - src/somefile.php:9:32 - Method B::bar does not exist ```
This test has been failed with an error "UndefinedMethod". This error is being issued correctly. But so that this error would not interfere with the test, it was suppressed. Fixed problem: ``` MagicMethodAnnotationTest::testValidCode with data set "magicStaticMethodInheritanceWithoutCallStatic" Psalm\Exception\CodeException: UndefinedMethod - src/somefile.php:9:32 - Method B::bar does not exist ```
Failed tests: ``` 1) MagicMethodAnnotationTest::testInvalidCode with data set "staticInvocationWithInstanceMethodFoo" Failed asserting that exception of type "Psalm\Exception\CodeException" is thrown. 2) MagicMethodAnnotationTest::testInvalidCode with data set "nonStaticSelfCallWithInstanceMethodFoo" Failed asserting that exception of type "Psalm\Exception\CodeException" is thrown. ```
The code has been moved from down to up. Resolved problems: ``` 1) MagicMethodAnnotationTest::testInvalidCode with data set "staticInvocationWithInstanceMethodFoo" Failed asserting that exception of type "Psalm\Exception\CodeException" is thrown. 2) MagicMethodAnnotationTest::testInvalidCode with data set "nonStaticSelfCallWithInstanceMethodFoo" Failed asserting that exception of type "Psalm\Exception\CodeException" is thrown. ```
Description of motivation. We currently have two different behaviors for the code related to "CodeException": ``` $codebase->config->throw_exception = true; // or false ``` If "throw_exception" is set to `true`, code execution stops. If "throw_exception" is set to `false`, the code may continue to execute, and an error may potentially occur. This commit allows testing for the second case, when the value of "throw_exception" will be "false".
Failed tests: ``` 1) Psalm\Tests\MagicMethodAnnotationTest::testInvalidCodeWithIssues with data set "staticInvocationWithMagicMethodFoo" UnexpectedValueException: Cannot get method params for A::foo 2) Psalm\Tests\MagicMethodAnnotationTest::testInvalidCodeWithIssues with data set "nonStaticSelfCallWithMagicMethodFoo" UnexpectedValueException: Cannot get method params for B::foo ```
Resolved problems: ``` 1) Psalm\Tests\MagicMethodAnnotationTest::testInvalidCodeWithIssues with data set "staticInvocationWithMagicMethodFoo" UnexpectedValueException: Cannot get method params for A::foo 2) Psalm\Tests\MagicMethodAnnotationTest::testInvalidCodeWithIssues with data set "nonStaticSelfCallWithMagicMethodFoo" UnexpectedValueException: Cannot get method params for B::foo ```
Apply suggestions from code review. Co-authored-by: Bruce Weirdan <[email protected]>
Co-authored-by: Bruce Weirdan <[email protected]>
Apply suggestions from code review. Failed tests: ``` 1) MagicMethodAnnotationTest::testValidCode with data set "magicStaticMethodInheritanceWithoutCallStatic" Psalm\Exception\CodeException: UnusedPsalmSuppress - src/somefile.php:9:58 - This suppression is never used 2) MagicMethodAnnotationTest::testValidCode with data set "magicStaticMethodInheritanceWithoutCallStatic_WithReturnAndManyArgs" Psalm\Exception\CodeException: TooManyArguments - src/somefile.php:9:6 - Too many arguments for B::bar - expecting 0 but saw 2 ``` Co-authored-by: Bruce Weirdan <[email protected]>
Apply suggestions from code review. Resolved problems: ``` 1) MagicMethodAnnotationTest::testValidCode with data set "magicStaticMethodInheritanceWithoutCallStatic" Psalm\Exception\CodeException: UnusedPsalmSuppress - src/somefile.php:9:58 - This suppression is never used 2) MagicMethodAnnotationTest::testValidCode with data set "magicStaticMethodInheritanceWithoutCallStatic_WithReturnAndManyArgs" Psalm\Exception\CodeException: TooManyArguments - src/somefile.php:9:6 - Too many arguments for B::bar - expecting 0 but saw 2 ```
…rings * Fix vimeo#9782 and related issues * add explicit handling for non-falsy-string to not fallback non-falsy-string and 0 to string
Signed-off-by: George Steel <[email protected]>
…lowercase-and-falsy-in-loop
… is no explicit truthy/falsy type
…truthyfalsycomparison
…e-context Allow `Override` attribute to be used in pure contexts
This may resolve vimeo#10706, although I'm not exactly convinced it's the best way.
…ceptions-during-scanning
Use TaintKind/TaintKindGroup constants instead of string values
Fixes vimeo#6449 Symlinks on Windows are rare (and quite unreliable)
…-windows Skip symlink test on Windows
…rom-phar-on-windows Fix loading stubs from phar file on Windows
4273e3b
to
33140d2
Compare
33140d2
to
22056c6
Compare
orklah
approved these changes
Feb 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SensitiveParameterValue
Override
attribute to be used in pure contexts