@@ -15,14 +15,14 @@ |
||
15 | 15 | |
16 | 16 | private function setConsts() |
17 | 17 | { |
18 | - if (! defined('DS')) { |
|
18 | + if (!defined('DS')) { |
|
19 | 19 | define('DS', DIRECTORY_SEPARATOR); |
20 | 20 | } |
21 | 21 | } |
22 | 22 | |
23 | 23 | private function registerFacade() |
24 | 24 | { |
25 | - $this->app->bind('filesystem',function() { |
|
25 | + $this->app->bind('filesystem', function() { |
|
26 | 26 | return new FileSystem(); |
27 | 27 | }); |
28 | 28 | } |
@@ -22,7 +22,8 @@ |
||
22 | 22 | |
23 | 23 | private function registerFacade() |
24 | 24 | { |
25 | - $this->app->bind('filesystem',function() { |
|
25 | + $this->app->bind('filesystem',function() |
|
26 | + { |
|
26 | 27 | return new FileSystem(); |
27 | 28 | }); |
28 | 29 | } |
@@ -17,7 +17,7 @@ |
||
17 | 17 | { |
18 | 18 | $func = 'get' . ucfirst($name); |
19 | 19 | |
20 | - if (! method_exists($this, $func)) { |
|
20 | + if (!method_exists($this, $func)) { |
|
21 | 21 | throw new \Exception("Has not attribute in class"); |
22 | 22 | } |
23 | 23 |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | private function setLocation(string $location) : FileHandler |
42 | 42 | { |
43 | - if (! strlen($location)) { |
|
43 | + if (!strlen($location)) { |
|
44 | 44 | throw new \Exception('Folder not defined.'); |
45 | 45 | } |
46 | 46 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | private function setName(string $name) : FileHandler |
58 | 58 | { |
59 | - if (! strlen($name)) { |
|
59 | + if (!strlen($name)) { |
|
60 | 60 | throw new \Exception('File name not defined.'); |
61 | 61 | } |
62 | 62 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | return $this; |
88 | 88 | |
89 | 89 | } catch (\Exception $e) { |
90 | - throw new Exception('Error to create file: '.$e->getMessage()); |
|
90 | + throw new Exception('Error to create file: ' . $e->getMessage()); |
|
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
@@ -102,14 +102,14 @@ discard block |
||
102 | 102 | |
103 | 103 | $location = $this->getLocation(); |
104 | 104 | |
105 | - if (! is_dir($location)) { |
|
105 | + if (!is_dir($location)) { |
|
106 | 106 | mkdir($location, $this->permission, true); |
107 | 107 | } |
108 | 108 | |
109 | 109 | return $this; |
110 | 110 | |
111 | 111 | } catch (\Exception $e) { |
112 | - throw new Exception("Error to create folder: ". $e->getMessage()); |
|
112 | + throw new Exception("Error to create folder: " . $e->getMessage()); |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | */ |
159 | 159 | private function analizeFilename() : FileHandler |
160 | 160 | { |
161 | - if (! str_contains($this->name, '/')) { |
|
161 | + if (!str_contains($this->name, '/')) { |
|
162 | 162 | return $this; |
163 | 163 | } |
164 | 164 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | { |
30 | 30 | $this->initStructure()->setName($name); |
31 | 31 | |
32 | - if (! $this->exists()) { |
|
32 | + if (!$this->exists()) { |
|
33 | 33 | return $this; |
34 | 34 | } |
35 | 35 | |
@@ -154,6 +154,6 @@ discard block |
||
154 | 154 | |
155 | 155 | $cached = Cache::get($name); |
156 | 156 | |
157 | - return (! $cached) ? false : true; |
|
157 | + return (!$cached) ? false : true; |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | \ No newline at end of file |
@@ -37,8 +37,8 @@ |
||
37 | 37 | public function __construct(string $source, string $name) |
38 | 38 | { |
39 | 39 | $this->setSourcePath($source) |
40 | - ->setName($name) |
|
41 | - ->loadContent(); |
|
40 | + ->setName($name) |
|
41 | + ->loadContent(); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | { |
52 | 52 | $source = PathSanitizer::sanitize($source); |
53 | 53 | |
54 | - if (! is_dir($source)) { |
|
54 | + if (!is_dir($source)) { |
|
55 | 55 | $err = sprintf('Template folder [%s] not found', $source); |
56 | 56 | throw new \Exception($err); |
57 | 57 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | { |
71 | 71 | $file = $this->getStubFile($name); |
72 | 72 | |
73 | - if (! is_file($file)) { |
|
73 | + if (!is_file($file)) { |
|
74 | 74 | throw new \Exception("Stub file called '{$file}' not found in folder template"); |
75 | 75 | } |
76 | 76 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | { |
103 | 103 | $name = $name ?? $this->name; |
104 | 104 | |
105 | - if (! $name) { |
|
105 | + if (!$name) { |
|
106 | 106 | throw new \Exception('Stub name bad formatted'); |
107 | 107 | } |
108 | 108 |
@@ -99,12 +99,12 @@ |
||
99 | 99 | return $this->templatePath; |
100 | 100 | } |
101 | 101 | |
102 | - /** |
|
103 | - * Retorna caminho baseado nas configurações de template |
|
104 | - * |
|
105 | - * @param string $file |
|
106 | - * @return string |
|
107 | - */ |
|
102 | + /** |
|
103 | + * Retorna caminho baseado nas configurações de template |
|
104 | + * |
|
105 | + * @param string $file |
|
106 | + * @return string |
|
107 | + */ |
|
108 | 108 | public function findByTemplate(string $template) : string |
109 | 109 | { |
110 | 110 | $folder = $this->finder->findByTemplate($template); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function root(string $path = null) |
39 | 39 | { |
40 | - return (! $path) ? $this->getRoot() : $this->setRoot($path); |
|
40 | + return (!$path) ? $this->getRoot() : $this->setRoot($path); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function template(string $path = null) |
74 | 74 | { |
75 | - return (! $path) ? $this->getTemplate() : $this->setTemplate($path); |
|
75 | + return (!$path) ? $this->getTemplate() : $this->setTemplate($path); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function paths(array $paths = null) |
124 | 124 | { |
125 | - if (! $paths) { |
|
125 | + if (!$paths) { |
|
126 | 126 | return $this->getPaths(); |
127 | 127 | } |
128 | 128 |
@@ -5,7 +5,7 @@ |
||
5 | 5 | use Maestriam\FileSystem\Concerns\FluentGetter; |
6 | 6 | |
7 | 7 | class StructureDirectory |
8 | -{ |
|
8 | +{ |
|
9 | 9 | use FluentGetter; |
10 | 10 | |
11 | 11 | /** |
@@ -89,7 +89,7 @@ |
||
89 | 89 | { |
90 | 90 | $structure = $this->getStructureDirectory(); |
91 | 91 | |
92 | - foreach($structure as $key => $path) |
|
92 | + foreach ($structure as $key => $path) |
|
93 | 93 | { |
94 | 94 | if ($key == '*') { |
95 | 95 | return $path; |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | use Maestriam\FileSystem\Foundation\Drive\StructureDirectory; |
7 | 7 | |
8 | 8 | class PathFinder |
9 | -{ |
|
9 | +{ |
|
10 | 10 | private array $structureDirectory; |
11 | 11 | |
12 | 12 | /** |
@@ -89,8 +89,7 @@ discard block |
||
89 | 89 | { |
90 | 90 | $structure = $this->getStructureDirectory(); |
91 | 91 | |
92 | - foreach($structure as $key => $path) |
|
93 | - { |
|
92 | + foreach($structure as $key => $path) { |
|
94 | 93 | if ($key == '*') { |
95 | 94 | return $path; |
96 | 95 | } |
@@ -40,8 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function name(string $name = null) |
42 | 42 | { |
43 | - return (! $name) ? $this->getName() : |
|
44 | - $this->setName($name); |
|
43 | + return (!$name) ? $this->getName() : $this->setName($name); |
|
45 | 44 | } |
46 | 45 | |
47 | 46 | /** |
@@ -74,8 +73,7 @@ discard block |
||
74 | 73 | */ |
75 | 74 | public function folder(string $folder = null) |
76 | 75 | { |
77 | - return (! $folder) ? $this->getFolder() : |
|
78 | - $this->setFolder($folder); |
|
76 | + return (!$folder) ? $this->getFolder() : $this->setFolder($folder); |
|
79 | 77 | } |
80 | 78 | |
81 | 79 | /** |
@@ -108,7 +106,7 @@ discard block |
||
108 | 106 | */ |
109 | 107 | private function initHandler() : FileHandler |
110 | 108 | { |
111 | - if (! $this->folder || ! $this->name) { |
|
109 | + if (!$this->folder || !$this->name) { |
|
112 | 110 | throw new \Exception("Error Processing Request"); |
113 | 111 | } |
114 | 112 |
@@ -3,7 +3,7 @@ |
||
3 | 3 | namespace Maestriam\FileSystem\Foundation\Drive; |
4 | 4 | |
5 | 5 | abstract class PathSanitizer |
6 | -{ |
|
6 | +{ |
|
7 | 7 | /** |
8 | 8 | * Ajusta uma string de caminho para |
9 | 9 | * |