misc: refactor attribute definition to include class definition #96
Annotations
11 warnings
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, actions/cache@v3, actions/[email protected]. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
Running mutation tests:
src/Definition/Repository/Reflection/ReflectionClassDefinitionRepository.php#L148
Escaped Mutant for Mutator "SpreadRemoval":
--- Original
+++ New
@@ @@
$localAliases = $this->localTypeAliases($type);
$importedAliases = $this->importedTypeAliases($type);
$duplicates = [];
- $keys = [...array_keys($generics), ...array_keys($localAliases), ...array_keys($importedAliases)];
+ $keys = [...array_keys($generics), ...array_keys($localAliases), array_keys($importedAliases)];
foreach ($keys as $key) {
$sameKeys = array_filter($keys, fn($value) => $value === $key);
if (count($sameKeys) > 1) {
|
Running mutation tests:
src/Definition/Repository/Reflection/ReflectionClassDefinitionRepository.php#L191
Escaped Mutant for Mutator "UnwrapTrim":
--- Original
+++ New
@@ @@
try {
$types[$name] = $typeParser->parse($raw);
} catch (InvalidType $exception) {
- $raw = trim($raw);
+ $raw = $raw;
$types[$name] = UnresolvableType::forLocalAlias($raw, $name, $type, $exception);
}
}
|
Running mutation tests:
src/Definition/Repository/Reflection/ReflectionClassDefinitionRepository.php#L239
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
}
private function typeParser(ClassType $type) : TypeParser
{
- $specs = [new ClassContextSpecification($type->className()), new AliasSpecification(Reflection::class($type->className()))];
+ $specs = [new AliasSpecification(Reflection::class($type->className()))];
if ($type instanceof GenericType) {
$specs[] = new TypeAliasAssignerSpecification($type->generics());
}
|
Running mutation tests:
src/Definition/Repository/Reflection/ReflectionParameterDefinitionBuilder.php#L40
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
} else {
$defaultValue = null;
}
- if ($isOptional && !$type instanceof UnresolvableType && !$type->accepts($defaultValue)) {
+ if ($isOptional && !false && !$type->accepts($defaultValue)) {
$type = UnresolvableType::forInvalidParameterDefaultValue($signature, $type, $defaultValue);
}
return new ParameterDefinition($name, $signature, $type, $isOptional, $isVariadic, $defaultValue, new Attributes(...$this->attributes($reflection)));
|
Running mutation tests:
src/Definition/Repository/Reflection/ReflectionPropertyDefinitionBuilder.php#L35
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
$hasDefaultValue = $this->hasDefaultValue($reflection, $type);
$defaultValue = $reflection->getDefaultValue();
$isPublic = $reflection->isPublic();
- if ($hasDefaultValue && !$type instanceof UnresolvableType && !$type->accepts($defaultValue)) {
+ if ($hasDefaultValue && !false && !$type->accepts($defaultValue)) {
$type = UnresolvableType::forInvalidPropertyDefaultValue($signature, $type, $defaultValue);
}
return new PropertyDefinition($name, $signature, $type, $hasDefaultValue, $defaultValue, $isPublic, new Attributes(...$this->attributes($reflection)));
|
Running mutation tests:
src/Definition/Repository/Reflection/ReflectionTypeResolver.php#L47
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
if (!$typeFromDocBlock) {
return $nativeType;
}
- if (!$typeFromDocBlock instanceof UnresolvableType && !$nativeType instanceof UnresolvableType && !$typeFromDocBlock->matches($nativeType)) {
+ if (!false && !$nativeType instanceof UnresolvableType && !$typeFromDocBlock->matches($nativeType)) {
throw new TypesDoNotMatch($reflection, $typeFromDocBlock, $nativeType);
}
return $typeFromDocBlock;
|
Running mutation tests:
src/Definition/Repository/Reflection/ReflectionTypeResolver.php#L106
Escaped Mutant for Mutator "UnwrapTrim":
--- Original
+++ New
@@ @@
try {
return $parser->parse($raw);
} catch (InvalidType $exception) {
- $raw = trim($raw);
+ $raw = $raw;
$signature = Reflection::signature($reflection);
if ($reflection instanceof ReflectionProperty) {
return UnresolvableType::forProperty($raw, $signature, $exception);
|
Running mutation tests:
src/Library/Container.php#L139
Escaped Mutant for Mutator "GreaterThan":
--- Original
+++ New
@@ @@
$builder = new InterfaceNodeBuilder($builder, $this->get(ObjectImplementations::class), $this->get(ClassDefinitionRepository::class), $this->get(ObjectBuilderFactory::class), $this->get(ObjectNodeBuilder::class), $settings->enableFlexibleCasting);
$builder = new CasterProxyNodeBuilder($builder);
$builder = new IterableNodeBuilder($builder);
- if (count($settings->valueModifier) > 0) {
+ if (count($settings->valueModifier) >= 0) {
$builder = new ValueAlteringNodeBuilder($builder, new FunctionsContainer($this->get(FunctionDefinitionRepository::class), $settings->valueModifier));
}
$builder = new StrictNodeBuilder($builder, $settings->allowPermissiveTypes, $settings->enableFlexibleCasting);
|
Running mutation tests:
src/Mapper/Object/Argument.php#L79
Escaped Mutant for Mutator "AssignCoalesce":
--- Original
+++ New
@@ @@
}
public function attributes() : Attributes
{
- return $this->attributes ??= Attributes::empty();
+ return $this->attributes = Attributes::empty();
}
}
|
Running mutation tests:
src/Mapper/Object/ArgumentsValues.php#L41
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
public static function forInterface(Arguments $arguments, mixed $value) : self
{
$self = new self($arguments);
- $self->forInterface = true;
+ $self->forInterface = false;
if (count($arguments) > 0) {
$self = $self->transform($value);
}
|
The logs for this run have expired and are no longer available.
Loading