Remove unnecessary check in ContainerAttributeResolverFactory
(#58)
#297
Annotations
10 warnings
mutation / PHP 8.2-ubuntu-latest:
src/Attribute/Parameter/DiResolver.php#L48
Escaped Mutant for Mutator "Throw_":
--- Original
+++ New
@@ @@
try {
return Result::success($this->container->get($id));
} catch (NotFoundExceptionInterface $e) {
- throw new DiNotFoundException($parameter, $e);
+ new DiNotFoundException($parameter, $e);
}
}
$type = $parameter->getType();
|
mutation / PHP 8.2-ubuntu-latest:
src/Attribute/Parameter/ToString.php#L33
Escaped Mutant for Mutator "CastString":
--- Original
+++ New
@@ @@
if ($context->isResolved()) {
$resolvedValue = $context->getResolvedValue();
if (is_scalar($resolvedValue) || null === $resolvedValue || $resolvedValue instanceof Stringable) {
- return Result::success((string) $resolvedValue);
+ return Result::success($resolvedValue);
}
return Result::success('');
}
|
mutation / PHP 8.2-ubuntu-latest:
src/Exception/AbstractClassException.php#L13
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
{
public function __construct(ReflectionClass $reflectionClass)
{
- parent::__construct(sprintf('%s is not instantiable because it is abstract.', $reflectionClass->getName()));
+
}
}
|
mutation / PHP 8.2-ubuntu-latest:
src/Exception/NonExistClassException.php#L11
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
{
public function __construct(string $class)
{
- parent::__construct(sprintf('Class %s not exist.', $class));
+
}
}
|
mutation / PHP 8.2-ubuntu-latest:
src/Exception/NonPublicConstructorException.php#L14
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
public function __construct(ReflectionMethod $constructor)
{
$type = $this->getConstructorType($constructor);
- parent::__construct(sprintf('%s is not instantiable because contain non-public%s constructor.', $constructor->getDeclaringClass()->getName(), $type !== null ? ' (' . $type . ')' : ''));
+
}
private function getConstructorType(ReflectionMethod $constructor) : ?string
{
|
mutation / PHP 8.2-ubuntu-latest:
src/Exception/NonPublicConstructorException.php#L18
Escaped Mutant for Mutator "Concat":
--- Original
+++ New
@@ @@
public function __construct(ReflectionMethod $constructor)
{
$type = $this->getConstructorType($constructor);
- parent::__construct(sprintf('%s is not instantiable because contain non-public%s constructor.', $constructor->getDeclaringClass()->getName(), $type !== null ? ' (' . $type . ')' : ''));
+ parent::__construct(sprintf('%s is not instantiable because contain non-public%s constructor.', $constructor->getDeclaringClass()->getName(), $type !== null ? $type . ' (' . ')' : ''));
}
private function getConstructorType(ReflectionMethod $constructor) : ?string
{
|
mutation / PHP 8.2-ubuntu-latest:
src/Exception/NonPublicConstructorException.php#L18
Escaped Mutant for Mutator "ConcatOperandRemoval":
--- Original
+++ New
@@ @@
public function __construct(ReflectionMethod $constructor)
{
$type = $this->getConstructorType($constructor);
- parent::__construct(sprintf('%s is not instantiable because contain non-public%s constructor.', $constructor->getDeclaringClass()->getName(), $type !== null ? ' (' . $type . ')' : ''));
+ parent::__construct(sprintf('%s is not instantiable because contain non-public%s constructor.', $constructor->getDeclaringClass()->getName(), $type !== null ? $type . ')' : ''));
}
private function getConstructorType(ReflectionMethod $constructor) : ?string
{
|
mutation / PHP 8.2-ubuntu-latest:
src/Exception/NonPublicConstructorException.php#L18
Escaped Mutant for Mutator "ConcatOperandRemoval":
--- Original
+++ New
@@ @@
public function __construct(ReflectionMethod $constructor)
{
$type = $this->getConstructorType($constructor);
- parent::__construct(sprintf('%s is not instantiable because contain non-public%s constructor.', $constructor->getDeclaringClass()->getName(), $type !== null ? ' (' . $type . ')' : ''));
+ parent::__construct(sprintf('%s is not instantiable because contain non-public%s constructor.', $constructor->getDeclaringClass()->getName(), $type !== null ? ' (' . ')' : ''));
}
private function getConstructorType(ReflectionMethod $constructor) : ?string
{
|
mutation / PHP 8.2-ubuntu-latest:
src/Exception/NonPublicConstructorException.php#L18
Escaped Mutant for Mutator "Concat":
--- Original
+++ New
@@ @@
public function __construct(ReflectionMethod $constructor)
{
$type = $this->getConstructorType($constructor);
- parent::__construct(sprintf('%s is not instantiable because contain non-public%s constructor.', $constructor->getDeclaringClass()->getName(), $type !== null ? ' (' . $type . ')' : ''));
+ parent::__construct(sprintf('%s is not instantiable because contain non-public%s constructor.', $constructor->getDeclaringClass()->getName(), $type !== null ? ' (' . ')' . $type : ''));
}
private function getConstructorType(ReflectionMethod $constructor) : ?string
{
|
mutation / PHP 8.2-ubuntu-latest:
src/Exception/NonPublicConstructorException.php#L18
Escaped Mutant for Mutator "ConcatOperandRemoval":
--- Original
+++ New
@@ @@
public function __construct(ReflectionMethod $constructor)
{
$type = $this->getConstructorType($constructor);
- parent::__construct(sprintf('%s is not instantiable because contain non-public%s constructor.', $constructor->getDeclaringClass()->getName(), $type !== null ? ' (' . $type . ')' : ''));
+ parent::__construct(sprintf('%s is not instantiable because contain non-public%s constructor.', $constructor->getDeclaringClass()->getName(), $type !== null ? ' (' . $type : ''));
}
private function getConstructorType(ReflectionMethod $constructor) : ?string
{
|