Skip to content

Fix empty string and "0" keys usage for CSS/JS in WebView + Improve psalm #833

Fix empty string and "0" keys usage for CSS/JS in WebView + Improve psalm

Fix empty string and "0" keys usage for CSS/JS in WebView + Improve psalm #833

Triggered via pull request September 30, 2024 08:44
@vjikvjik
opened #273
rm-risky
Status Success
Total duration 1m 34s
Artifacts

mutation.yml

on: pull_request
Matrix: mutation / roave-infection
Fit to window
Zoom out
Zoom in

Annotations

10 warnings
mutation / PHP 8.3-ubuntu-latest: src/Cache/CachedContent.php#L66
Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ * * @return string The rendered cached content. */ - public function cache(string $content, DateInterval|int|null $ttl = 60, Dependency|null $dependency = null, float $beta = 1.0) : string + public function cache(string $content, DateInterval|int|null $ttl = 59, Dependency|null $dependency = null, float $beta = 1.0) : string { /** @psalm-suppress MixedArgument */ return $this->replaceDynamicPlaceholders($this->cache->getOrSet($this->cacheKey(), static fn(): string => $content, $ttl, $dependency, $beta));
mutation / PHP 8.3-ubuntu-latest: src/Cache/CachedContent.php#L66
Escaped Mutant for Mutator "IncrementInteger": --- Original +++ New @@ @@ * * @return string The rendered cached content. */ - public function cache(string $content, DateInterval|int|null $ttl = 60, Dependency|null $dependency = null, float $beta = 1.0) : string + public function cache(string $content, DateInterval|int|null $ttl = 61, Dependency|null $dependency = null, float $beta = 1.0) : string { /** @psalm-suppress MixedArgument */ return $this->replaceDynamicPlaceholders($this->cache->getOrSet($this->cacheKey(), static fn(): string => $content, $ttl, $dependency, $beta));
mutation / PHP 8.3-ubuntu-latest: src/Cache/CachedContent.php#L68
Escaped Mutant for Mutator "OneZeroFloat": --- Original +++ New @@ @@ * * @return string The rendered cached content. */ - public function cache(string $content, DateInterval|int|null $ttl = 60, Dependency|null $dependency = null, float $beta = 1.0) : string + public function cache(string $content, DateInterval|int|null $ttl = 60, Dependency|null $dependency = null, float $beta = 0.0) : string { /** @psalm-suppress MixedArgument */ return $this->replaceDynamicPlaceholders($this->cache->getOrSet($this->cacheKey(), static fn(): string => $content, $ttl, $dependency, $beta));
mutation / PHP 8.3-ubuntu-latest: src/PhpTemplateRenderer.php#L33
Escaped Mutant for Mutator "FalseValue": --- Original +++ New @@ @@ }; $obInitialLevel = ob_get_level(); ob_start(); - ob_implicit_flush(false); + ob_implicit_flush(true); try { /** @psalm-suppress PossiblyInvalidFunctionCall,PossiblyNullFunctionCall */ $renderer->bindTo($view)($template, $parameters);
mutation / PHP 8.3-ubuntu-latest: src/PhpTemplateRenderer.php#L33
Escaped Mutant for Mutator "FunctionCallRemoval": --- Original +++ New @@ @@ }; $obInitialLevel = ob_get_level(); ob_start(); - ob_implicit_flush(false); + try { /** @psalm-suppress PossiblyInvalidFunctionCall,PossiblyNullFunctionCall */ $renderer->bindTo($view)($template, $parameters);
mutation / PHP 8.3-ubuntu-latest: src/State/WebViewState.php#L633
Escaped Mutant for Mutator "IncrementInteger": --- Original +++ New @@ @@ if (!is_string($key)) { throw new InvalidArgumentException(sprintf('JS variable name should be string. Got %s.', get_debug_type($key))); } - if (!array_key_exists(1, $config)) { + if (!array_key_exists(2, $config)) { throw new InvalidArgumentException('Do not set JS variable value.'); } /** @var mixed */
mutation / PHP 8.3-ubuntu-latest: src/View.php#L66
Escaped Mutant for Mutator "FalseValue": --- Original +++ New @@ @@ public function beginPage() : void { ob_start(); - ob_implicit_flush(false); + ob_implicit_flush(true); $this->eventDispatcher?->dispatch(new PageBegin($this)); } /**
mutation / PHP 8.3-ubuntu-latest: src/View.php#L66
Escaped Mutant for Mutator "FunctionCallRemoval": --- Original +++ New @@ @@ public function beginPage() : void { ob_start(); - ob_implicit_flush(false); + $this->eventDispatcher?->dispatch(new PageBegin($this)); } /**
mutation / PHP 8.3-ubuntu-latest: src/ViewTrait.php#L117
Escaped Mutant for Mutator "UnwrapArrayValues": --- Original +++ New @@ @@ public function withFallbackExtension(string $fallbackExtension, string ...$otherFallbacks) : static { $new = clone $this; - $new->fallbackExtensions = [$fallbackExtension, ...array_values($otherFallbacks)]; + $new->fallbackExtensions = [$fallbackExtension, ...$otherFallbacks]; return $new; } /**
mutation / PHP 8.3-ubuntu-latest: src/ViewTrait.php#L442
Escaped Mutant for Mutator "Coalesce": --- Original +++ New @@ @@ $this->viewFiles[] = ['resolved' => $viewFile, 'requested' => $requestedFile]; if ($this->beforeRender($viewFile, $parameters)) { $ext = pathinfo($viewFile, PATHINFO_EXTENSION); - $renderer = $this->renderers[$ext] ?? new PhpTemplateRenderer(); + $renderer = new PhpTemplateRenderer() ?? $this->renderers[$ext]; $output = $renderer->render($this, $viewFile, $parameters); $output = $this->afterRender($viewFile, $parameters, $output); }