@@ -66,8 +66,7 @@ discard block |
||
| 66 | 66 | { |
| 67 | 67 | // Local file system adapter |
| 68 | 68 | $this->register('local', function(string $sRootDir, $xOptions) { |
| 69 | - return empty($xOptions) ? new LocalFilesystemAdapter($sRootDir) : |
|
| 70 | - new LocalFilesystemAdapter($sRootDir, $xOptions); |
|
| 69 | + return empty($xOptions) ? new LocalFilesystemAdapter($sRootDir) : new LocalFilesystemAdapter($sRootDir, $xOptions); |
|
| 71 | 70 | }); |
| 72 | 71 | } |
| 73 | 72 | |
@@ -81,7 +80,7 @@ discard block |
||
| 81 | 80 | */ |
| 82 | 81 | public function make(string $sAdapter, string $sRootDir, array $aOptions = []): Filesystem |
| 83 | 82 | { |
| 84 | - if(!isset($this->aAdapters[$sAdapter]) || !is_callable($this->aAdapters[$sAdapter])) |
|
| 83 | + if (!isset($this->aAdapters[$sAdapter]) || !is_callable($this->aAdapters[$sAdapter])) |
|
| 85 | 84 | { |
| 86 | 85 | $this->logger->error("Jaxon Storage: adapter '$sAdapter' not configured."); |
| 87 | 86 | throw new RequestException($this->xTranslator->trans('errors.storage.adapter')); |
@@ -99,7 +98,7 @@ discard block |
||
| 99 | 98 | public function get(string $sOptionName): Filesystem |
| 100 | 99 | { |
| 101 | 100 | $sConfigKey = "storage.$sOptionName"; |
| 102 | - if(!$this->xConfigManager->hasAppOption($sConfigKey)) |
|
| 101 | + if (!$this->xConfigManager->hasAppOption($sConfigKey)) |
|
| 103 | 102 | { |
| 104 | 103 | $this->logger->error("Jaxon Storage: No '$sConfigKey' in options."); |
| 105 | 104 | throw new RequestException($this->xTranslator->trans('errors.storage.options')); |
@@ -108,7 +107,7 @@ discard block |
||
| 108 | 107 | $sAdapter = $this->xConfigManager->getAppOption("$sConfigKey.adapter"); |
| 109 | 108 | $sRootDir = $this->xConfigManager->getAppOption("$sConfigKey.dir"); |
| 110 | 109 | $aOptions = $this->xConfigManager->getAppOption("$sConfigKey.options", []); |
| 111 | - if(!is_string($sAdapter) || !is_string($sRootDir) || !is_array($aOptions)) |
|
| 110 | + if (!is_string($sAdapter) || !is_string($sRootDir) || !is_array($aOptions)) |
|
| 112 | 111 | { |
| 113 | 112 | $this->logger->error("Jaxon Storage: incorrect values in '$sConfigKey' options."); |
| 114 | 113 | throw new RequestException($this->xTranslator->trans('errors.storage.options')); |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | function _register(): void |
| 20 | 20 | { |
| 21 | 21 | $di = jaxon()->di(); |
| 22 | - if(!$di->h(StorageManager::class)) |
|
| 22 | + if (!$di->h(StorageManager::class)) |
|
| 23 | 23 | { |
| 24 | 24 | // File storage |
| 25 | 25 | $di->set(StorageManager::class, function($c): StorageManager { |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | function register() |
| 41 | 41 | { |
| 42 | 42 | // Do nothing if running in cli. |
| 43 | - if(php_sapi_name() !== 'cli') |
|
| 43 | + if (php_sapi_name() !== 'cli') |
|
| 44 | 44 | { |
| 45 | 45 | _register(); |
| 46 | 46 | }; |