Handle race condition when creating cache directory #329
Annotations
4 warnings
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
Run roave infection.:
src/FileCache.php#L94
Escaped Mutant for Mutator "IncrementInteger":
--- 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 = 510)
{
}
public function get(string $key, mixed $default = null) : mixed
|
Run roave infection.:
src/FileCache.php#L130
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) {
|
Run roave infection.:
src/FileCache.php#L178
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
public function getMultiple(iterable $keys, mixed $default = null) : iterable
{
$keys = $this->iterableToArray($keys);
- $this->validateKeys($keys);
+
$results = [];
foreach ($keys as $key) {
$results[$key] = $this->get($key, $default);
|
Loading