Skip to content

Commit

Permalink
refactor: simplify Config->getCacheDir()
Browse files Browse the repository at this point in the history
  • Loading branch information
Chemaclass committed Dec 1, 2024
1 parent 78317ec commit 810bd6e
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/Framework/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use RuntimeException;

use function array_key_exists;
use function is_string;

final class Config implements ConfigInterface
{
Expand Down Expand Up @@ -126,16 +125,11 @@ public function getCacheDir(): string
return $this->cacheDir;
}

$cacheDir = getenv('GACELA_CACHE_DIR');
if (is_string($cacheDir)) {
$this->cacheDir = rtrim($cacheDir, DIRECTORY_SEPARATOR);
return $this->cacheDir;
}

$this->cacheDir = $this->getAppRootDir()
$this->cacheDir = getenv('GACELA_CACHE_DIR') ?: $this->getAppRootDir()
. DIRECTORY_SEPARATOR
. ltrim($this->setup->getFileCacheDirectory(), DIRECTORY_SEPARATOR);
return $this->cacheDir;

return rtrim($this->cacheDir, DIRECTORY_SEPARATOR);
}

/**
Expand Down

0 comments on commit 810bd6e

Please sign in to comment.