@@ -41,7 +41,9 @@ discard block |
||
41 | 41 | { |
42 | 42 | $no = $this->existsKey($key); |
43 | 43 | |
44 | - if ($no === null) return null; |
|
44 | + if ($no === null) { |
|
45 | + return null; |
|
46 | + } |
|
45 | 47 | |
46 | 48 | $lines = $this->lines(); |
47 | 49 | |
@@ -64,7 +66,9 @@ discard block |
||
64 | 66 | $lines = $this->lines(); |
65 | 67 | $pattern = strtoupper('/'. $key . '=/'); |
66 | 68 | |
67 | - if (empty($lines)) return null; |
|
69 | + if (empty($lines)) { |
|
70 | + return null; |
|
71 | + } |
|
68 | 72 | |
69 | 73 | foreach($lines as $no => $line) { |
70 | 74 | if (preg_match($pattern, $line)) { |
@@ -16,11 +16,11 @@ |
||
16 | 16 | } |
17 | 17 | |
18 | 18 | /** |
19 | - * Cria um novo arquivo de configurações do ambiente do projeto |
|
20 | - * |
|
21 | - * @param string $custom |
|
22 | - * @return integer |
|
23 | - */ |
|
19 | + * Cria um novo arquivo de configurações do ambiente do projeto |
|
20 | + * |
|
21 | + * @param string $custom |
|
22 | + * @return integer |
|
23 | + */ |
|
24 | 24 | public function initEnv() : int |
25 | 25 | { |
26 | 26 | return touch($this->file()); |
@@ -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 | } |
@@ -87,11 +87,11 @@ discard block |
||
87 | 87 | { |
88 | 88 | $search = null; |
89 | 89 | $lines = $this->lines(); |
90 | - $pattern = strtoupper('/'. $key . '=/'); |
|
90 | + $pattern = strtoupper('/' . $key . '=/'); |
|
91 | 91 | |
92 | 92 | if (empty($lines)) return null; |
93 | 93 | |
94 | - foreach($lines as $no => $line) { |
|
94 | + foreach ($lines as $no => $line) { |
|
95 | 95 | if (preg_match($pattern, $line)) { |
96 | 96 | $search = $no; |
97 | 97 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | public function content() : string |
133 | 133 | { |
134 | - if (! $this->exists()) { |
|
134 | + if (!$this->exists()) { |
|
135 | 135 | throw new EnvNotFoundException(); |
136 | 136 | } |
137 | 137 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | */ |
19 | 19 | public function directive(string $name, string $type) : string |
20 | 20 | { |
21 | - return $name . '-' .$type; |
|
21 | + return $name . '-' . $type; |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -37,9 +37,9 @@ |
||
37 | 37 | public function parse(string $file) : DirectiveParser |
38 | 38 | { |
39 | 39 | $this->setFile($file) |
40 | - ->setRelative() |
|
41 | - ->setNameAndType() |
|
42 | - ->setSentence(); |
|
40 | + ->setRelative() |
|
41 | + ->setNameAndType() |
|
42 | + ->setSentence(); |
|
43 | 43 | |
44 | 44 | return $this; |
45 | 45 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | /** |
61 | 61 | * {@inheritDoc} |
62 | 62 | */ |
63 | - public function toDirective() : Component|Includer |
|
63 | + public function toDirective() : Component | Includer |
|
64 | 64 | { |
65 | 65 | return ($this->type == 'component') ? $this->toComponent() : $this->toIncluder(); |
66 | 66 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | |
168 | 168 | $this->type = array_pop($part); |
169 | 169 | |
170 | - if (! $this->validator()->type($this->type)) { |
|
170 | + if (!$this->validator()->type($this->type)) { |
|
171 | 171 | throw new InvalidTypeDirectiveException($this->type); |
172 | 172 | } |
173 | 173 | |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | */ |
184 | 184 | private function setSentence() : DirectiveParser |
185 | 185 | { |
186 | - $search = '-' . $this->type. '.blade'; |
|
186 | + $search = '-' . $this->type . '.blade'; |
|
187 | 187 | |
188 | 188 | $sentence = str_replace($search, '', $this->relative); |
189 | 189 | $sentence = str_replace('.php', '', $sentence); |
@@ -29,7 +29,7 @@ |
||
29 | 29 | |
30 | 30 | $files = $this->readFiles(); |
31 | 31 | |
32 | - foreach($files as $file) { |
|
32 | + foreach ($files as $file) { |
|
33 | 33 | $directives[] = $this->parser()->parse($file)->toDirective(); |
34 | 34 | } |
35 | 35 |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | return false; |
63 | 63 | } |
64 | 64 | |
65 | - if (! preg_match($onlyValidChars, $name)) { |
|
65 | + if (!preg_match($onlyValidChars, $name)) { |
|
66 | 66 | return false; |
67 | 67 | } |
68 | 68 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function type(string $type = null) : bool |
80 | 80 | { |
81 | - if (! $type) { |
|
81 | + if (!$type) { |
|
82 | 82 | return false; |
83 | 83 | } |
84 | 84 |
@@ -40,7 +40,7 @@ |
||
40 | 40 | $folder = $this->parseFolder($file); |
41 | 41 | |
42 | 42 | if (! $name) { |
43 | - return null; |
|
43 | + return null; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | return (object) ['name' => $name, 'folder' => $folder]; |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | $type = $this->parseType($file); |
18 | 18 | $name = $this->parseFullName($file); |
19 | 19 | |
20 | - if (! $name || ! $type) return null; |
|
20 | + if (!$name || !$type) return null; |
|
21 | 21 | |
22 | 22 | $request = [ |
23 | 23 | 'name' => $name, |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $name = $this->parseOnlyName($file); |
40 | 40 | $folder = $this->parseFolder($file); |
41 | 41 | |
42 | - if (! $name) { |
|
42 | + if (!$name) { |
|
43 | 43 | return null; |
44 | 44 | } |
45 | 45 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | |
133 | 133 | $name = (count($pieces) > 1) ? implode(DS, $pieces) : $pieces[0]; |
134 | 134 | |
135 | - return (! strlen($name)) ? null : $name; |
|
135 | + return (!strlen($name)) ? null : $name; |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | /** |
@@ -17,7 +17,9 @@ |
||
17 | 17 | $type = $this->parseType($file); |
18 | 18 | $name = $this->parseFullName($file); |
19 | 19 | |
20 | - if (! $name || ! $type) return null; |
|
20 | + if (! $name || ! $type) { |
|
21 | + return null; |
|
22 | + } |
|
21 | 23 | |
22 | 24 | $request = [ |
23 | 25 | 'name' => $name, |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function findOrBuild() : Theme |
43 | 43 | { |
44 | - if (! $this->exists()) { |
|
44 | + if (!$this->exists()) { |
|
45 | 45 | return $this->build(); |
46 | 46 | } |
47 | 47 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function get() : ?Theme |
58 | 58 | { |
59 | - if (! $this->exists()) { |
|
59 | + if (!$this->exists()) { |
|
60 | 60 | return null; |
61 | 61 | } |
62 | 62 |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function public(string $vendor, string $name) : string |
83 | 83 | { |
84 | - return public_path('themes'. DS . $vendor . DS . $name); |
|
84 | + return public_path('themes' . DS . $vendor . DS . $name); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | |
98 | 98 | $pieces = explode(DS, $dir); |
99 | 99 | |
100 | - return ($path == true ) ? $dir : end($pieces); |
|
100 | + return ($path == true) ? $dir : end($pieces); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | /** |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | private function registerFacade() |
32 | 32 | { |
33 | - $this->app->bind('samurai',function() { |
|
33 | + $this->app->bind('samurai', function() { |
|
34 | 34 | return new Samurai(); |
35 | 35 | }); |
36 | 36 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | protected function registerConfigs() |
44 | 44 | { |
45 | - $source = __DIR__.'/../Config/config.php'; |
|
45 | + $source = __DIR__ . '/../Config/config.php'; |
|
46 | 46 | $published = config_path('samurai.php'); |
47 | 47 | |
48 | 48 | $this->publishes([$source => $published], 'samurai'); |