@@ -21,7 +21,7 @@ |
||
| 21 | 21 | return $themes; |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - foreach($folders as $folder) { |
|
| 24 | + foreach ($folders as $folder) { |
|
| 25 | 25 | |
| 26 | 26 | $theme = $this->themefy($folder); |
| 27 | 27 | |
@@ -25,7 +25,9 @@ |
||
| 25 | 25 | |
| 26 | 26 | $theme = $this->themefy($folder); |
| 27 | 27 | |
| 28 | - if ($theme == null) continue; |
|
| 28 | + if ($theme == null) { |
|
| 29 | + continue; |
|
| 30 | + } |
|
| 29 | 31 | |
| 30 | 32 | $themes[] = $theme; |
| 31 | 33 | } |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | */ |
| 131 | 131 | protected function env() : EnvHandler |
| 132 | 132 | { |
| 133 | - if (! $this->env) { |
|
| 133 | + if (!$this->env) { |
|
| 134 | 134 | $this->env = new EnvHandler(); |
| 135 | 135 | } |
| 136 | 136 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | protected function config() : ConfigKeeper |
| 146 | 146 | { |
| 147 | - if (! $this->config) { |
|
| 147 | + if (!$this->config) { |
|
| 148 | 148 | $this->config = new ConfigKeeper(); |
| 149 | 149 | } |
| 150 | 150 | |
@@ -207,11 +207,11 @@ discard block |
||
| 207 | 207 | { |
| 208 | 208 | $parsed = $this->parser()->filename($sentence); |
| 209 | 209 | |
| 210 | - if (! property_exists($parsed, 'name')) { |
|
| 210 | + if (!property_exists($parsed, 'name')) { |
|
| 211 | 211 | throw new InvalidDirectiveNameException($sentence); |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | - if (! $this->valid()->directive($parsed->name)) { |
|
| 214 | + if (!$this->valid()->directive($parsed->name)) { |
|
| 215 | 215 | throw new InvalidDirectiveNameException($sentence); |
| 216 | 216 | } |
| 217 | 217 | |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | */ |
| 228 | 228 | private function setTheme(Theme $theme) : self |
| 229 | 229 | { |
| 230 | - if (! $theme instanceof Theme) { |
|
| 230 | + if (!$theme instanceof Theme) { |
|
| 231 | 231 | throw new ThemeNotFoundException($theme); |
| 232 | 232 | } |
| 233 | 233 | |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | */ |
| 300 | 300 | private function setType(string $type) : self |
| 301 | 301 | { |
| 302 | - if (! $this->valid()->type($type)) { |
|
| 302 | + if (!$this->valid()->type($type)) { |
|
| 303 | 303 | throw new InvalidTypeDirectiveException($type); |
| 304 | 304 | } |
| 305 | 305 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | ->setDescription($desc); |
| 75 | 75 | |
| 76 | 76 | $preview = $this->getComposer(); |
| 77 | - $ask = 'Confirm? '. PHP_EOL . $preview; |
|
| 77 | + $ask = 'Confirm? ' . PHP_EOL . $preview; |
|
| 78 | 78 | |
| 79 | 79 | return (object) [ |
| 80 | 80 | 'ask' => $ask, |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $vendor = $author->vendor; |
| 95 | 95 | $theme = $this->dir()->project(); |
| 96 | 96 | |
| 97 | - return $vendor .'/'. $theme . '-theme'; |
|
| 97 | + return $vendor . '/' . $theme . '-theme'; |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /** |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | $lenght = rand(0, 50); |
| 23 | 23 | |
| 24 | 24 | $vendor = 'vendor-' . Str::random($lenght); |
| 25 | - $theme = 'theme-' . Str::random($lenght); |
|
| 25 | + $theme = 'theme-' . Str::random($lenght); |
|
| 26 | 26 | |
| 27 | 27 | $name = strtolower($vendor . '/' . $theme); |
| 28 | 28 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | private function parseVendor() |
| 21 | 21 | { |
| 22 | - if (! $this->vendor) { |
|
| 22 | + if (!$this->vendor) { |
|
| 23 | 23 | throw new InvalidThemeNameException($this->vendor); |
| 24 | 24 | } |
| 25 | 25 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | private function setName(string $name) |
| 102 | 102 | { |
| 103 | - if (! $this->isValidName($name)) { |
|
| 103 | + if (!$this->isValidName($name)) { |
|
| 104 | 104 | throw new InvalidThemeNameException($name); |
| 105 | 105 | } |
| 106 | 106 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | private function setDistributor(string $dist) |
| 118 | 118 | { |
| 119 | - if (! $this->isValidName($dist)) { |
|
| 119 | + if (!$this->isValidName($dist)) { |
|
| 120 | 120 | throw new InvalidThemeNameException($dist); |
| 121 | 121 | } |
| 122 | 122 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | $collection = []; |
| 24 | 24 | |
| 25 | - foreach($files as $path) { |
|
| 25 | + foreach ($files as $path) { |
|
| 26 | 26 | |
| 27 | 27 | $request = $this->parseFilePath($path); |
| 28 | 28 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | public function include(string $name) : Directive |
| 47 | 47 | { |
| 48 | - if (! $this->exists()) { |
|
| 48 | + if (!$this->exists()) { |
|
| 49 | 49 | throw new ThemeNotFoundException($this->name); |
| 50 | 50 | } |
| 51 | 51 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | public function component(string $name) : Directive |
| 62 | 62 | { |
| 63 | - if (! $this->exists()) { |
|
| 63 | + if (!$this->exists()) { |
|
| 64 | 64 | throw new ThemeNotFoundException($this->name); |
| 65 | 65 | } |
| 66 | 66 | |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | if (empty($directives)) return true; |
| 95 | 95 | |
| 96 | - foreach($directives as $directive) { |
|
| 96 | + foreach ($directives as $directive) { |
|
| 97 | 97 | $directive->load(); |
| 98 | 98 | } |
| 99 | 99 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | private function scan() : array |
| 110 | 110 | { |
| 111 | - if (! $this->exists()) { |
|
| 111 | + if (!$this->exists()) { |
|
| 112 | 112 | throw new ThemeNotFoundException($this->name); |
| 113 | 113 | } |
| 114 | 114 | |
@@ -18,7 +18,9 @@ discard block |
||
| 18 | 18 | { |
| 19 | 19 | $files = $this->scan(); |
| 20 | 20 | |
| 21 | - if (empty($files)) return []; |
|
| 21 | + if (empty($files)) { |
|
| 22 | + return []; |
|
| 23 | + } |
|
| 22 | 24 | |
| 23 | 25 | $collection = []; |
| 24 | 26 | |
@@ -26,7 +28,9 @@ discard block |
||
| 26 | 28 | |
| 27 | 29 | $request = $this->parseFilePath($path); |
| 28 | 30 | |
| 29 | - if ($request == null) continue; |
|
| 31 | + if ($request == null) { |
|
| 32 | + continue; |
|
| 33 | + } |
|
| 30 | 34 | |
| 31 | 35 | $obj = $this->directivefy($request->name, $request->type); |
| 32 | 36 | |
@@ -91,7 +95,9 @@ discard block |
||
| 91 | 95 | { |
| 92 | 96 | $directives = $this->directives(); |
| 93 | 97 | |
| 94 | - if (empty($directives)) return true; |
|
| 98 | + if (empty($directives)) { |
|
| 99 | + return true; |
|
| 100 | + } |
|
| 95 | 101 | |
| 96 | 102 | foreach($directives as $directive) { |
| 97 | 103 | $directive->load(); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | public function publish() : bool |
| 57 | 57 | { |
| 58 | - if (! $this->exists()) { |
|
| 58 | + if (!$this->exists()) { |
|
| 59 | 59 | throw new ThemeNotFoundException($this->name); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function use() : bool |
| 76 | 76 | { |
| 77 | - if (! $this->exists()) { |
|
| 77 | + if (!$this->exists()) { |
|
| 78 | 78 | throw new ThemeNotFoundException($this->name); |
| 79 | 79 | } |
| 80 | 80 | |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | namespace Maestriam\Samurai\Traits\Theme; |
| 4 | 4 | |
| 5 | -use Maestriam\Samurai\Models\Theme;; |
|
| 5 | +use Maestriam\Samurai\Models\Theme; ; |
|
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | 8 | * Funcionalidades de acessórios(getters/setters) |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | public function findOrBuild() : Theme |
| 20 | 20 | { |
| 21 | - if (! $this->exists()) { |
|
| 21 | + if (!$this->exists()) { |
|
| 22 | 22 | return $this->build(); |
| 23 | 23 | } |
| 24 | 24 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | public function get() : ?Theme |
| 35 | 35 | { |
| 36 | - if (! $this->exists()) { |
|
| 36 | + if (!$this->exists()) { |
|
| 37 | 37 | return null; |
| 38 | 38 | } |
| 39 | 39 | |