Update favicon processing to include hashing (#205) #12
infection.yml
on: push
0️⃣ Mutation Testing
2m 1s
Annotations
10 warnings
0️⃣ Mutation Testing:
src/Attribute/PreloadUrlCompilerPass.php#L24
Escaped Mutant for Mutator "Foreach_":
--- Original
+++ New
@@ @@
{
public function process(ContainerBuilder $container): void
{
- foreach ($this->findAllTaggedRoutes($container) as $alias => $urls) {
+ foreach ([] as $alias => $urls) {
$definitionId = sprintf('spomky_labs_pwa.preload_urls_tag_generator.%s', $alias);
$definition = new ChildDefinition(PreloadUrlsTagGenerator::class);
$definition->setArguments(['$alias' => $alias, '$urls' => $urls])->addTag('spomky_labs_pwa.preload_urls_generator');
|
0️⃣ Mutation Testing:
src/Attribute/PreloadUrlCompilerPass.php#L45
Escaped Mutant for Mutator "UnwrapArrayKeys":
--- Original
+++ New
@@ @@
{
$routes = [];
$controllers = $container->findTaggedServiceIds('controller.service_arguments');
- foreach (array_keys($controllers) as $controller) {
+ foreach ($controllers as $controller) {
if (!is_string($controller) || !class_exists($controller)) {
continue;
}
|
0️⃣ Mutation Testing:
src/Attribute/PreloadUrlCompilerPass.php#L45
Escaped Mutant for Mutator "Foreach_":
--- Original
+++ New
@@ @@
{
$routes = [];
$controllers = $container->findTaggedServiceIds('controller.service_arguments');
- foreach (array_keys($controllers) as $controller) {
+ foreach ([] as $controller) {
if (!is_string($controller) || !class_exists($controller)) {
continue;
}
|
0️⃣ Mutation Testing:
src/Attribute/PreloadUrlCompilerPass.php#L46
Escaped Mutant for Mutator "LogicalNot":
--- Original
+++ New
@@ @@
$routes = [];
$controllers = $container->findTaggedServiceIds('controller.service_arguments');
foreach (array_keys($controllers) as $controller) {
- if (!is_string($controller) || !class_exists($controller)) {
+ if (!is_string($controller) || class_exists($controller)) {
continue;
}
$reflectionClass = new ReflectionClass($controller);
|
0️⃣ Mutation Testing:
src/Attribute/PreloadUrlCompilerPass.php#L46
Escaped Mutant for Mutator "LogicalOrAllSubExprNegation":
--- Original
+++ New
@@ @@
$routes = [];
$controllers = $container->findTaggedServiceIds('controller.service_arguments');
foreach (array_keys($controllers) as $controller) {
- if (!is_string($controller) || !class_exists($controller)) {
+ if (is_string($controller) || class_exists($controller)) {
continue;
}
$reflectionClass = new ReflectionClass($controller);
|
0️⃣ Mutation Testing:
src/Attribute/PreloadUrlCompilerPass.php#L51
Escaped Mutant for Mutator "Foreach_":
--- Original
+++ New
@@ @@
}
$reflectionClass = new ReflectionClass($controller);
$result = $this->findAllPreloadAttributesForClass($reflectionClass);
- foreach ($result as $route) {
+ foreach ([] as $route) {
if (!array_key_exists($route['alias'], $routes)) {
$routes[$route['alias']] = [];
}
|
0️⃣ Mutation Testing:
src/Attribute/PreloadUrlCompilerPass.php#L59
Escaped Mutant for Mutator "ArrayOneItem":
--- Original
+++ New
@@ @@
$routes[$route['alias']][] = $route;
}
}
- return $routes;
+ return (count($routes) > 1) ? array_slice($routes, 0, 1, true) : $routes;
}
/**
* @param ReflectionClass<object> $reflectionClass
|
0️⃣ Mutation Testing:
src/Attribute/PreloadUrlCompilerPass.php#L80
Escaped Mutant for Mutator "Foreach_":
--- Original
+++ New
@@ @@
throw new RuntimeException(sprintf('Unable to create attribute instance: %s', $e->getMessage()), 0, $e);
}
}
- foreach ($reflectionClass->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
+ foreach ([] as $method) {
foreach ($method->getAttributes(PreloadUrl::class, ReflectionAttribute::IS_INSTANCEOF) as $attribute) {
try {
/** @var PreloadUrl $preloadAttribute */
|
0️⃣ Mutation Testing:
src/Attribute/PreloadUrlCompilerPass.php#L81
Escaped Mutant for Mutator "Foreach_":
--- Original
+++ New
@@ @@
}
}
foreach ($reflectionClass->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
- foreach ($method->getAttributes(PreloadUrl::class, ReflectionAttribute::IS_INSTANCEOF) as $attribute) {
+ foreach ([] as $attribute) {
try {
/** @var PreloadUrl $preloadAttribute */
$preloadAttribute = $attribute->newInstance();
|
0️⃣ Mutation Testing:
src/Attribute/PreloadUrlCompilerPass.php#L112
Escaped Mutant for Mutator "Foreach_":
--- Original
+++ New
@@ @@
*/
private function findAllRoutesForMethod(PreloadUrl $preloadAttribute, ReflectionMethod $method): iterable
{
- foreach ($method->getAttributes(Route::class, ReflectionAttribute::IS_INSTANCEOF) as $attribute) {
+ foreach ([] as $attribute) {
try {
/** @var Route $routeAttribute */
$routeAttribute = $attribute->newInstance();
|