-
Notifications
You must be signed in to change notification settings - Fork 134
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
Improved mutation score #1221
Improved mutation score #1221
Conversation
…onal() and without mutants
@@ -25,12 +24,12 @@ public function __construct( | |||
IntersectionType $type, | |||
) { | |||
/** @var non-empty-list<ReflectionNamedType> $types */ |
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.
In theory not needed? Should be inferred 🤔
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.
ERROR: MixedPropertyTypeCoercion - src/Reflection/ReflectionIntersectionType.php:33:24 - $this->types expects 'non-empty-list<Roave\BetterReflection\Reflection\ReflectionNamedType>', parent type `array<array-key, Roave\BetterReflection\Reflection\ReflectionNamedType>` provided (see https://psalm.dev/196)
$this->types = $types;
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.
We just did an array_map()
with a closure with well defined return types, and it failed inference? :O
@@ -28,12 +27,12 @@ public function __construct( | |||
UnionType $type, | |||
) { | |||
/** @var non-empty-list<ReflectionNamedType|ReflectionIntersectionType> $types */ |
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.
Should also not be needed
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.
ERROR: MixedPropertyTypeCoercion - src/Reflection/ReflectionUnionType.php:36:24 - $this->types expects 'non-empty-list<Roave\BetterReflection\Reflection\ReflectionIntersectionType|Roave\BetterReflection\Reflection\ReflectionNamedType>', parent type `array<array-key, Roave\BetterReflection\Reflection\ReflectionIntersectionType|Roave\BetterReflection\Reflection\ReflectionNamedType>` provided (see https://psalm.dev/196)
$this->types = $types;
); | ||
} | ||
|
||
return $parameters; | ||
} | ||
|
||
/** @param list<Node\Param> $parameterNodes */ | ||
private function isParameterOptional(array $parameterNodes, ParamNode $parameterNode, int $parameterIndex): bool | ||
private function isParameterOptional(array $parameterNodes, int $parameterIndex): bool |
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.
Somehow, roave/backward-compatibility-check
picked up this change:
[BC] CHANGED: The parameter $parameterNode of Roave\BetterReflection\Reflection\ReflectionFunctionAbstract#isParameterOptional() changed from PhpParser\Node\Param to a non-contravariant int
[BC] CHANGED: The parameter $parameterNode of Roave\BetterReflection\Reflection\ReflectionFunctionAbstract#isParameterOptional() changed from PhpParser\Node\Param to int
[BC] CHANGED: Parameter 1 of Roave\BetterReflection\Reflection\ReflectionFunctionAbstract#isParameterOptional() changed name from parameterNode to parameterIndex
Ignoring for now, just an interesting bug though: possibly due to abstract
class not having many filters on method visibility analysis.
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.
Thanks @kukulich!
No description provided.