@@ -110,8 +110,7 @@ discard block |
||
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | $this->{$mapping['setter']}(config($key)); |
| 113 | - } |
|
| 114 | - else |
|
| 113 | + } else |
|
| 115 | 114 | { |
| 116 | 115 | if (!method_exists($this->writer, $mapping['setter'])) |
| 117 | 116 | { |
@@ -152,20 +151,23 @@ discard block |
||
| 152 | 151 | if ($this->cache) { |
| 153 | 152 | $text = cache($this->cacheKey, null); |
| 154 | 153 | |
| 155 | - if (!is_null($text)) |
|
| 156 | - return $text; |
|
| 154 | + if (!is_null($text)) { |
|
| 155 | + return $text; |
|
| 156 | + } |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | $text = $this->writer |
| 160 | 160 | ->generate() |
| 161 | 161 | ->getText(); |
| 162 | 162 | |
| 163 | - if ($this->writer->getComments()) |
|
| 164 | - $text .= '# Cache is ' . ($this->cache ? 'enabled with key "' . $this->cacheKey . '"' : 'disabled') . '.' . PHP_EOL . |
|
| 163 | + if ($this->writer->getComments()) { |
|
| 164 | + $text .= '# Cache is ' . ($this->cache ? 'enabled with key "' . $this->cacheKey . '"' : 'disabled') . '.' . PHP_EOL . |
|
| 165 | 165 | '#' . PHP_EOL; |
| 166 | + } |
|
| 166 | 167 | |
| 167 | - if ($this->cache) |
|
| 168 | - cache([$this->cacheKey => $text], now()->addMinutes($this->cacheTime)); |
|
| 168 | + if ($this->cache) { |
|
| 169 | + cache([$this->cacheKey => $text], now()->addMinutes($this->cacheTime)); |
|
| 170 | + } |
|
| 169 | 171 | |
| 170 | 172 | return empty($text) ? '' : $text; |
| 171 | 173 | } |
@@ -28,8 +28,9 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | public function show() |
| 30 | 30 | { |
| 31 | - if (!config('security-txt.enabled', false)) |
|
| 32 | - abort(404); |
|
| 31 | + if (!config('security-txt.enabled', false)) { |
|
| 32 | + abort(404); |
|
| 33 | + } |
|
| 33 | 34 | |
| 34 | 35 | return \Response::make((new SecurityTxtHelper)->fetch(), 200, ['Content-Type' => 'text/plain']); |
| 35 | 36 | } |
@@ -39,11 +39,13 @@ |
||
| 39 | 39 | __DIR__ . '/config/security-txt.php' => config_path('security-txt.php'), |
| 40 | 40 | ]); |
| 41 | 41 | |
| 42 | - if (!$this->app->routesAreCached()) |
|
| 43 | - require __DIR__ . '/routes/security-txt.php'; |
|
| 42 | + if (!$this->app->routesAreCached()) { |
|
| 43 | + require __DIR__ . '/routes/security-txt.php'; |
|
| 44 | + } |
|
| 44 | 45 | |
| 45 | - if (!defined('LARAVEL_SECURITY_TXT_VERSION')) |
|
| 46 | - define('LARAVEL_SECURITY_TXT_VERSION', SecurityTxtHelper::VERSION); |
|
| 46 | + if (!defined('LARAVEL_SECURITY_TXT_VERSION')) { |
|
| 47 | + define('LARAVEL_SECURITY_TXT_VERSION', SecurityTxtHelper::VERSION); |
|
| 48 | + } |
|
| 47 | 49 | } |
| 48 | 50 | |
| 49 | 51 | /** |