Skip to content

Commit c0de50f

Browse files
committed
refactor: remove $val
1 parent f631512 commit c0de50f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

system/Cache/FactoriesCache/FileVarExportHandler.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function save(string $key, $val): void
2424

2525
// Write to temp file first to ensure atomicity
2626
$tmp = $this->path . "/{$key}." . uniqid('', true) . '.tmp';
27-
file_put_contents($tmp, '<?php $val = ' . $val . ';', LOCK_EX);
27+
file_put_contents($tmp, '<?php return ' . $val . ';', LOCK_EX);
2828

2929
rename($tmp, $this->path . "/{$key}");
3030
}
@@ -39,8 +39,6 @@ public function delete(string $key): void
3939
*/
4040
public function get(string $key)
4141
{
42-
@include $this->path . "/{$key}";
43-
44-
return $val ?? false; // @phpstan-ignore-line
42+
return @include $this->path . "/{$key}";
4543
}
4644
}

0 commit comments

Comments
 (0)