Add layout specific injections #551
Annotations
10 warnings
mutation / PHP 8.2-ubuntu-latest:
src/Debug/WebViewCollector.php#L28
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
if (!$this->isActive()) {
return;
}
- $this->renders[] = ['output' => $event->getResult(), 'file' => $event->getFile(), 'parameters' => $event->getParameters()];
+ $this->renders[] = ['file' => $event->getFile(), 'parameters' => $event->getParameters()];
}
private function reset() : void
{
|
mutation / PHP 8.2-ubuntu-latest:
src/Debug/WebViewCollector.php#L29
Escaped Mutant for Mutator "ArrayItem":
--- Original
+++ New
@@ @@
if (!$this->isActive()) {
return;
}
- $this->renders[] = ['output' => $event->getResult(), 'file' => $event->getFile(), 'parameters' => $event->getParameters()];
+ $this->renders[] = ['output' > $event->getResult(), 'file' => $event->getFile(), 'parameters' => $event->getParameters()];
}
private function reset() : void
{
|
mutation / PHP 8.2-ubuntu-latest:
src/Debug/WebViewCollector.php#L30
Escaped Mutant for Mutator "ArrayItem":
--- Original
+++ New
@@ @@
if (!$this->isActive()) {
return;
}
- $this->renders[] = ['output' => $event->getResult(), 'file' => $event->getFile(), 'parameters' => $event->getParameters()];
+ $this->renders[] = ['output' => $event->getResult(), 'file' > $event->getFile(), 'parameters' => $event->getParameters()];
}
private function reset() : void
{
|
mutation / PHP 8.2-ubuntu-latest:
src/Debug/WebViewCollector.php#L31
Escaped Mutant for Mutator "ArrayItem":
--- Original
+++ New
@@ @@
if (!$this->isActive()) {
return;
}
- $this->renders[] = ['output' => $event->getResult(), 'file' => $event->getFile(), 'parameters' => $event->getParameters()];
+ $this->renders[] = ['output' => $event->getResult(), 'file' => $event->getFile(), 'parameters' > $event->getParameters()];
}
private function reset() : void
{
|
mutation / PHP 8.2-ubuntu-latest:
src/ViewRenderer.php#L249
Escaped Mutant for Mutator "UnwrapArrayMerge":
--- Original
+++ New
@@ @@
public function withAddedInjections(object ...$injections) : self
{
$new = clone $this;
- $new->injections = array_merge($this->injections, $injections);
+ $new->injections = $this->injections;
return $new;
}
/**
|
mutation / PHP 8.2-ubuntu-latest:
src/ViewRenderer.php#L249
Escaped Mutant for Mutator "UnwrapArrayMerge":
--- Original
+++ New
@@ @@
public function withAddedInjections(object ...$injections) : self
{
$new = clone $this;
- $new->injections = array_merge($this->injections, $injections);
+ $new->injections = $injections;
return $new;
}
/**
|
mutation / PHP 8.2-ubuntu-latest:
src/ViewRenderer.php#L272
Escaped Mutant for Mutator "CloneRemoval":
--- Original
+++ New
@@ @@
*/
public function withLocale(string $locale) : self
{
- $new = clone $this;
+ $new = $this;
$new->locale = $locale;
return $new;
}
|
mutation / PHP 8.2-ubuntu-latest:
src/ViewRenderer.php#L409
Escaped Mutant for Mutator "Continue_":
--- Original
+++ New
@@ @@
foreach ($this->injections as $injection) {
if ($injection instanceof $injectionInterface) {
$result[] = $injection;
- continue;
+ break;
}
if ($injection instanceof LayoutSpecificInjections && $injection->getLayout() === $layout) {
foreach ($injection->getInjections() as $layoutInjection) {
|
mutation / PHP 8.2-ubuntu-latest:
src/ViewRenderer.php#L518
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
return $file;
}
$layoutFile = $file . '.' . $view->getDefaultExtension();
- if ($view->getDefaultExtension() !== 'php' && !is_file($layoutFile)) {
+ if ($view->getDefaultExtension() !== 'php' || !is_file($layoutFile)) {
$layoutFile = $file . '.php';
}
return $layoutFile;
|
mutation / PHP 8.2-ubuntu-latest:
src/ViewRenderer.php#L554
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
return $cache[$class];
}
$regexp = '/((?<=controller\\\\|controllers\\\\)(?:[\\w\\\\]+)|(?:[a-z\\d]+))controller$/iU';
- if (!preg_match($regexp, $class, $m) || empty($m[1])) {
+ if (!preg_match($regexp, $class, $m) || empty($m[0])) {
throw new RuntimeException('Cannot detect controller name.');
}
$inflector = new Inflector();
|