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
```
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.
```
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
```
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
```
It's invalid in all PHP versions: https://3v4l.org/bXWo2
Also see php.net/manual/en/language.types.declarations.php#language.types.declarations.base.function
Fixesvimeo/psalm#10650
All we really need is for the source to be autoloadable, and it includes
all classlikes (interfaces, classes, enums and traits at the time of
writing).
In php-parser 5.0, `ClosureUse` is no longer considered an expression.
This requires changes to Psalm's `CheckTrivialExprVisitor`, which stores
an array of "non-trivial" `Expr` nodes.
However the only use of this array is to count whether or not it's
empty. Instead of keeping the array, we can keep a boolean, and avoid
needing to change the types in this class when we upgrade to php-parser
5.0.
This change is for forward-compatibility with nikic/php-parser 5.0,
where `InterpolatedStringPart` (née `EncapsedStringPart`) is no longer an expression.
Thus we can't pass it to `NodeTypeProvider::getType()` anymore. Since that call
returns `null` anyway, we can swap the condition order. Everything still
works and Psalm type-checking is happy.
This also might be a tiny performance improvement since it lets the
common, cheap instanceof check come before a method call, but I haven't actually
benchmarked it.