Skip to content

Commit

Permalink
Downgrade code
Browse files Browse the repository at this point in the history
  • Loading branch information
reimic committed Mar 18, 2024
1 parent bd7aad1 commit 51362f2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/WordPress/Blueprints/Cache/FileCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@

namespace WordPress\Blueprints\Cache;

use iterable;
use Psr\SimpleCache\CacheInterface;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Filesystem\Exception\IOExceptionInterface;

class FileCache implements CacheInterface {
private $filesystem;
/**
* @var string|null
*/
private $cacheDirectory;

public function __construct( private string|null $cacheDirectory = null ) {
public function __construct( $cacheDirectory = null ) {
$this->cacheDirectory = $cacheDirectory;
// initialize the Filesystem component
$this->filesystem = new Filesystem();

Expand All @@ -34,7 +40,7 @@ public function __construct( private string|null $cacheDirectory = null ) {
}
}

public function get( $key, $default = null ): mixed {
public function get( $key, $default = null ) {
$filepath = $this->getFilePathForKey( $key );
if ( ! file_exists( $filepath ) ) {
return $default;
Expand Down

0 comments on commit 51362f2

Please sign in to comment.