@@ -84,7 +84,7 @@ |
||
| 84 | 84 | |
| 85 | 85 | $preview = $theme->preview(); |
| 86 | 86 | |
| 87 | - $question = 'Confirm? '. PHP_EOL . $preview; |
|
| 87 | + $question = 'Confirm? '.PHP_EOL.$preview; |
|
| 88 | 88 | |
| 89 | 89 | return $this->question($question, false); |
| 90 | 90 | } |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | * @param string $name |
| 15 | 15 | */ |
| 16 | 16 | public function __construct(string $theme) |
| 17 | - { |
|
| 17 | + { |
|
| 18 | 18 | $this->initialize($theme); |
| 19 | 19 | } |
| 20 | 20 | |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | const CODE = '0104'; |
| 10 | 10 | |
| 11 | 11 | public function __construct($author) |
| 12 | - { |
|
| 12 | + { |
|
| 13 | 13 | $this->initialize($author); |
| 14 | 14 | } |
| 15 | 15 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function indicative(string $path) : string |
| 51 | 51 | { |
| 52 | - $base = base_path() . DS; |
|
| 52 | + $base = base_path().DS; |
|
| 53 | 53 | |
| 54 | 54 | return str_replace($base, '', $path); |
| 55 | 55 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | { |
| 65 | 65 | $assets = config('samurai.themes.assets'); |
| 66 | 66 | |
| 67 | - return $this->theme($vendor, $name) . DS . $assets; |
|
| 67 | + return $this->theme($vendor, $name).DS.$assets; |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public function public(string $vendor, string $name) : string |
| 78 | 78 | { |
| 79 | - return public_path('themes'. DS . $vendor . DS . $name); |
|
| 79 | + return public_path('themes'.DS.$vendor.DS.$name); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | $pieces = explode(DS, $dir); |
| 94 | 94 | |
| 95 | - return ($path == true ) ? $dir : end($pieces); |
|
| 95 | + return ($path == true) ? $dir : end($pieces); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | /** |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | { |
| 106 | 106 | $files = config('samurai.themes.files'); |
| 107 | 107 | |
| 108 | - return $this->theme($vendor, $name) . DS . $files . DS; |
|
| 108 | + return $this->theme($vendor, $name).DS.$files.DS; |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /** |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | { |
| 136 | 136 | $name = strtolower($name); |
| 137 | 137 | |
| 138 | - $path = $base . $vendor . DS . $name; |
|
| 138 | + $path = $base.$vendor.DS.$name; |
|
| 139 | 139 | |
| 140 | 140 | return $path; |
| 141 | 141 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | public function directive(string $name, string $type) : string |
| 22 | 22 | { |
| 23 | - return $name . '-' .$type; |
|
| 23 | + return $name.'-'.$type; |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | public function filename(string $name, string $type) : string |
| 35 | 35 | { |
| 36 | - return $this->directive($name, $type) . $this->extension(); |
|
| 36 | + return $this->directive($name, $type).$this->extension(); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | /** |
| 63 | 63 | * {@inheritDoc} |
| 64 | 64 | */ |
| 65 | - public function toDirective() : Component|Includer |
|
| 65 | + public function toDirective() : Component | Includer |
|
| 66 | 66 | { |
| 67 | 67 | return ($this->type == 'component') ? $this->toComponent() : $this->toIncluder(); |
| 68 | 68 | } |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | $this->type = array_pop($part); |
| 171 | 171 | |
| 172 | - if (! $this->validator()->type($this->type)) { |
|
| 172 | + if (!$this->validator()->type($this->type)) { |
|
| 173 | 173 | throw new InvalidTypeDirectiveException($this->type); |
| 174 | 174 | } |
| 175 | 175 | |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | */ |
| 186 | 186 | private function setSentence() : DirectiveParser |
| 187 | 187 | { |
| 188 | - $search = '-' . $this->type. '.blade'; |
|
| 188 | + $search = '-'.$this->type.'.blade'; |
|
| 189 | 189 | |
| 190 | 190 | $sentence = str_replace($search, '', $this->relative); |
| 191 | 191 | $sentence = str_replace('.php', '', $sentence); |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | public function __construct() |
| 12 | 12 | { |
| 13 | - if (! $this->exists()) { |
|
| 13 | + if (!$this->exists()) { |
|
| 14 | 14 | $this->initEnv(); |
| 15 | 15 | } |
| 16 | 16 | } |
@@ -88,12 +88,12 @@ discard block |
||
| 88 | 88 | { |
| 89 | 89 | $search = null; |
| 90 | 90 | $lines = $this->lines(); |
| 91 | - $pattern = strtoupper('/'. $key . '=/'); |
|
| 91 | + $pattern = strtoupper('/'.$key.'=/'); |
|
| 92 | 92 | |
| 93 | 93 | if (empty($lines)) { return null; |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - foreach($lines as $no => $line) { |
|
| 96 | + foreach ($lines as $no => $line) { |
|
| 97 | 97 | if (preg_match($pattern, $line)) { |
| 98 | 98 | $search = $no; |
| 99 | 99 | } |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | public function content() : string |
| 135 | 135 | { |
| 136 | - if (! $this->exists()) { |
|
| 136 | + if (!$this->exists()) { |
|
| 137 | 137 | throw new EnvNotFoundException(); |
| 138 | 138 | } |
| 139 | 139 | |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | private function append(string $key, string $value) |
| 151 | 151 | { |
| 152 | 152 | $lines = $this->lines(); |
| 153 | - $content = strtoupper($key) . '=' . $value; |
|
| 153 | + $content = strtoupper($key).'='.$value; |
|
| 154 | 154 | $lines[] = $content; |
| 155 | 155 | |
| 156 | 156 | return $this->store($lines); |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | private function change(int $line, string $key, string $value) |
| 168 | 168 | { |
| 169 | 169 | $lines = $this->lines(); |
| 170 | - $content = strtoupper($key) . '=' . $value; |
|
| 170 | + $content = strtoupper($key).'='.$value; |
|
| 171 | 171 | |
| 172 | 172 | $lines[$line] = $content; |
| 173 | 173 | |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | * @return mixed |
| 33 | 33 | */ |
| 34 | 34 | public function handle() |
| 35 | - { |
|
| 35 | + { |
|
| 36 | 36 | try { |
| 37 | 37 | |
| 38 | 38 | $this->clean(); |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | /** |
| 142 | 142 | * {@inheritDoc} |
| 143 | 143 | */ |
| 144 | - public function create() : Component|Includer |
|
| 144 | + public function create() : Component | Includer |
|
| 145 | 145 | { |
| 146 | 146 | if ($this->exists()) { |
| 147 | 147 | throw new DirectiveExistsException($this->name(), $this->theme()->package()); |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | /** |
| 157 | 157 | * {@inheritDoc} |
| 158 | 158 | */ |
| 159 | - public function load() : Component|Includer |
|
| 159 | + public function load() : Component | Includer |
|
| 160 | 160 | { |
| 161 | 161 | $alias = $this->alias(); |
| 162 | 162 | $view = $this->getViewComponent(); |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | |
| 182 | 182 | private function loadViewComponent($alias, $view) : Directive |
| 183 | 183 | { |
| 184 | - Blade::component($alias, $view); |
|
| 184 | + Blade::component($alias, $view); |
|
| 185 | 185 | |
| 186 | 186 | return $this; |
| 187 | 187 | } |
@@ -193,9 +193,9 @@ discard block |
||
| 193 | 193 | |
| 194 | 194 | $classes = get_declared_classes(); |
| 195 | 195 | |
| 196 | - foreach($classes as $class) { |
|
| 196 | + foreach ($classes as $class) { |
|
| 197 | 197 | |
| 198 | - if (! $this->isViewComponent($class, $name)) { |
|
| 198 | + if (!$this->isViewComponent($class, $name)) { |
|
| 199 | 199 | continue; |
| 200 | 200 | } |
| 201 | 201 | |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | |
| 208 | 208 | private function isViewComponent(string $class, string $name) : bool |
| 209 | 209 | { |
| 210 | - if (! is_subclass_of($class, ViewComponent::class)) { |
|
| 210 | + if (!is_subclass_of($class, ViewComponent::class)) { |
|
| 211 | 211 | return false; |
| 212 | 212 | } |
| 213 | 213 | |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | { |
| 228 | 228 | $path = $this->path(); |
| 229 | 229 | |
| 230 | - $base = $this->theme()->paths()->root() . DS; |
|
| 230 | + $base = $this->theme()->paths()->root().DS; |
|
| 231 | 231 | $base = FileSystem::folder($base)->sanitize(); |
| 232 | 232 | |
| 233 | 233 | return str_replace($base, '', $path); |
@@ -319,11 +319,11 @@ discard block |
||
| 319 | 319 | { |
| 320 | 320 | $parsed = $this->parser()->filename($sentence); |
| 321 | 321 | |
| 322 | - if (! $parsed) { |
|
| 322 | + if (!$parsed) { |
|
| 323 | 323 | throw new InvalidDirectiveNameException($sentence); |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | - if (! $this->valid()->directive($parsed->name)) { |
|
| 326 | + if (!$this->valid()->directive($parsed->name)) { |
|
| 327 | 327 | throw new InvalidDirectiveNameException($sentence); |
| 328 | 328 | } |
| 329 | 329 | |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | */ |
| 341 | 341 | protected function setType(string $type) : Directive |
| 342 | 342 | { |
| 343 | - if (! $this->valid()->type($type)) { |
|
| 343 | + if (!$this->valid()->type($type)) { |
|
| 344 | 344 | throw new InvalidTypeDirectiveException($type); |
| 345 | 345 | } |
| 346 | 346 | |
@@ -193,7 +193,7 @@ |
||
| 193 | 193 | |
| 194 | 194 | $classes = get_declared_classes(); |
| 195 | 195 | |
| 196 | - foreach($classes as $class) { |
|
| 196 | + foreach($classes as $class) { |
|
| 197 | 197 | |
| 198 | 198 | if (! $this->isViewComponent($class, $name)) { |
| 199 | 199 | continue; |