Skip to content

Update file

Update file #302

Triggered via pull request May 4, 2024 11:16
Status Success
Total duration 3m 42s
Artifacts

mutation.yml

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

Annotations

6 warnings
mutation / PHP 8.1-ubuntu-latest: src/FileCache.php#L92
Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ * * @throws CacheException If failed to create cache directory. */ - public function __construct(private string $cachePath, private int $directoryMode = 0775) + public function __construct(private string $cachePath, private int $directoryMode = 508) { if (!$this->createDirectoryIfNotExists($cachePath)) { throw new CacheException("Failed to create cache directory \"{$cachePath}\".");
mutation / PHP 8.1-ubuntu-latest: src/FileCache.php#L130
Escaped Mutant for Mutator "GreaterThan": --- Original +++ New @@ @@ } $file = $this->getCacheFile($key); $cacheDirectory = dirname($file); - if (!is_dir($this->cachePath) || $this->directoryLevel > 0 && !$this->createDirectoryIfNotExists($cacheDirectory)) { + if (!is_dir($this->cachePath) || $this->directoryLevel >= 0 && !$this->createDirectoryIfNotExists($cacheDirectory)) { throw new CacheException("Failed to create cache directory \"{$cacheDirectory}\"."); } // If ownership differs the touch call will fail, so we try to
mutation / PHP 8.1-ubuntu-latest: src/FileCache.php#L138
Escaped Mutant for Mutator "LogicalAndSingleSubExprNegation": --- Original +++ New @@ @@ // If ownership differs the touch call will fail, so we try to // rebuild the file from scratch by deleting it first // https://github.com/yiisoft/yii2/pull/16120 - if (function_exists('posix_geteuid') && is_file($file) && fileowner($file) !== posix_geteuid()) { + if (!function_exists('posix_geteuid') && is_file($file) && fileowner($file) !== posix_geteuid()) { @Unlink($file); } if (file_put_contents($file, serialize($value), LOCK_EX) === false) {
mutation / PHP 8.1-ubuntu-latest: src/FileCache.php#L194
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ public function setMultiple(iterable $values, null|int|DateInterval $ttl = null) : bool { $values = $this->iterableToArray($values); - $this->validateKeys(array_map('\\strval', array_keys($values))); + foreach ($values as $key => $value) { $this->set((string) $key, $value, $ttl); }
mutation / PHP 8.1-ubuntu-latest: src/FileCache.php#L212
Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ foreach ($keys as $key) { $this->delete($key); } - return true; + return false; } public function has(string $key) : bool {
mutation / PHP 8.1-ubuntu-latest: src/FileCache.php#L335
Escaped Mutant for Mutator "LogicalAnd": --- Original +++ New @@ @@ if (is_dir($path)) { return true; } - $result = !is_file($path) && mkdir(directory: $path, recursive: true) && is_dir($path); + $result = !is_file($path) && mkdir(directory: $path, recursive: true) || is_dir($path); if ($result) { chmod($path, $this->directoryMode); }