diff --git a/src/ImageStorage.php b/src/ImageStorage.php index aec33e3..3785789 100644 --- a/src/ImageStorage.php +++ b/src/ImageStorage.php @@ -25,7 +25,7 @@ public function __construct(?string $storagePath = null, string $relativeStorage } if ($storagePath === null && isset($_SERVER['SCRIPT_FILENAME'])) { $storagePath = dirname((string) $_SERVER['SCRIPT_FILENAME']) . DIRECTORY_SEPARATOR . $relativeStoragePath; - } else { + } elseif ($storagePath === null) { throw new \RuntimeException('Script filename is not available. Please define storagePath manually.'); } $this->storagePath = $storagePath;