@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | { |
34 | 34 | $name = (string) $this->argument('name'); |
35 | 35 | |
36 | - if (! $name) { |
|
36 | + if (!$name) { |
|
37 | 37 | throw new InvalidDirectiveNameException($name); |
38 | 38 | } |
39 | 39 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | $current = $this->base()->current(); |
57 | 57 | |
58 | - return $current->vendor .'/'. $current->name; |
|
58 | + return $current->vendor . '/' . $current->name; |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public final function success(string $message, bool $verbose = false, string $code = '0') : string |
20 | 20 | { |
21 | - if (! $verbose) { |
|
22 | - $message = Lang::get('Samurai::console.' .$message); |
|
21 | + if (!$verbose) { |
|
22 | + $message = Lang::get('Samurai::console.' . $message); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | $this->info($message); |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | { |
40 | 40 | $err = $this->getErrorConfig($code); |
41 | 41 | |
42 | - if (! $verbose) { |
|
43 | - $message = Lang::get('Samurai::console.' .$err['bash']); |
|
42 | + if (!$verbose) { |
|
43 | + $message = Lang::get('Samurai::console.' . $err['bash']); |
|
44 | 44 | } else { |
45 | 45 | $message = $message; |
46 | 46 | } |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | { |
63 | 63 | $search = null; |
64 | 64 | $lines = $this->lines(); |
65 | - $pattern = strtoupper('/'. $key . '=/'); |
|
65 | + $pattern = strtoupper('/' . $key . '=/'); |
|
66 | 66 | |
67 | 67 | if (empty($lines)) return null; |
68 | 68 | |
69 | - foreach($lines as $no => $line) { |
|
69 | + foreach ($lines as $no => $line) { |
|
70 | 70 | if (preg_match($pattern, $line)) { |
71 | 71 | $search = $no; |
72 | 72 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public function content() : string |
108 | 108 | { |
109 | - if (! $this->exists()) { |
|
109 | + if (!$this->exists()) { |
|
110 | 110 | throw new EnvNotFoundException(); |
111 | 111 | } |
112 | 112 |
@@ -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)) { |
@@ -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 | /** |
@@ -40,7 +40,9 @@ |
||
40 | 40 | $base = $this->base(); |
41 | 41 | $finded = $this->findVendor($vendor, $name); |
42 | 42 | |
43 | - if ($finded) return $finded; |
|
43 | + if ($finded) { |
|
44 | + return $finded; |
|
45 | + } |
|
44 | 46 | |
45 | 47 | return $this->findTheme($base, $vendor, $name); |
46 | 48 | } |
@@ -19,9 +19,7 @@ |
||
19 | 19 | |
20 | 20 | if (is_file($search)) { |
21 | 21 | $this->files[] = $search; |
22 | - } |
|
23 | - |
|
24 | - else { |
|
22 | + } else { |
|
25 | 23 | $this->scan($search); |
26 | 24 | } |
27 | 25 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | { |
17 | 17 | $permission = (int) Config::get('Samurai.permission'); |
18 | 18 | |
19 | - return (! $permission) ? 0755 : $permission; |
|
19 | + return (!$permission) ? 0755 : $permission; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
@@ -58,10 +58,10 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function stub(string $filename) : string |
60 | 60 | { |
61 | - $pattern = __DIR__ . DS . "../Stubs/%s.stub"; |
|
61 | + $pattern = __DIR__ . DS . "../Stubs/%s.stub"; |
|
62 | 62 | $file = sprintf($pattern, $filename); |
63 | 63 | |
64 | - if (! is_file($file)) { |
|
64 | + if (!is_file($file)) { |
|
65 | 65 | throw new StubNotFoundException($file); |
66 | 66 | } |
67 | 67 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | public function readDir($path) : array |
73 | 73 | { |
74 | - if (! is_dir($path)) return []; |
|
74 | + if (!is_dir($path)) return []; |
|
75 | 75 | |
76 | 76 | $content = scandir($path); |
77 | 77 | $content = array_splice($content, 2); |
@@ -71,7 +71,9 @@ |
||
71 | 71 | |
72 | 72 | public function readDir($path) : array |
73 | 73 | { |
74 | - if (! is_dir($path)) return []; |
|
74 | + if (! is_dir($path)) { |
|
75 | + return []; |
|
76 | + } |
|
75 | 77 | |
76 | 78 | $content = scandir($path); |
77 | 79 | $content = array_splice($content, 2); |
@@ -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 | /** |
@@ -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, |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $name = $this->parseOnlyName($file); |
39 | 39 | $folder = $this->parseFolder($file); |
40 | 40 | |
41 | - if (! $name) return null; |
|
41 | + if (!$name) return null; |
|
42 | 42 | |
43 | 43 | $request = [ |
44 | 44 | 'name' => $name, |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | |
131 | 131 | $name = (count($pieces) > 1) ? implode('/', $pieces) : $pieces[0]; |
132 | 132 | |
133 | - return (! strlen($name)) ? null : $name; |
|
133 | + return (!strlen($name)) ? null : $name; |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | /** |
@@ -17,7 +17,9 @@ 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) { |
|
21 | + return null; |
|
22 | + } |
|
21 | 23 | |
22 | 24 | $request = [ |
23 | 25 | 'name' => $name, |
@@ -38,7 +40,9 @@ discard block |
||
38 | 40 | $name = $this->parseOnlyName($file); |
39 | 41 | $folder = $this->parseFolder($file); |
40 | 42 | |
41 | - if (! $name) return null; |
|
43 | + if (! $name) { |
|
44 | + return null; |
|
45 | + } |
|
42 | 46 | |
43 | 47 | $request = [ |
44 | 48 | 'name' => $name, |
@@ -61,7 +61,7 @@ |
||
61 | 61 | return false; |
62 | 62 | } |
63 | 63 | |
64 | - if (! preg_match($onlyValidChars, $name)) { |
|
64 | + if (!preg_match($onlyValidChars, $name)) { |
|
65 | 65 | return false; |
66 | 66 | } |
67 | 67 |