@@ -63,14 +63,14 @@ discard block |
||
63 | 63 | |
64 | 64 | $output = trim(join("\n", $output), "\n ,"); |
65 | 65 | |
66 | - if ($output !== '') { |
|
66 | + if ($output !== ''){ |
|
67 | 67 | $this->files->deleteDirectory($tmpDir); |
68 | 68 | throw new CompileException($output); |
69 | 69 | } |
70 | 70 | |
71 | 71 | // copying files (using relative path and namespace) |
72 | 72 | $result = []; |
73 | - foreach ($this->files->getFiles($tmpDir) as $file) { |
|
73 | + foreach ($this->files->getFiles($tmpDir) as $file){ |
|
74 | 74 | $result[] = $this->copy($tmpDir, $file); |
75 | 75 | } |
76 | 76 | |
@@ -87,11 +87,11 @@ discard block |
||
87 | 87 | private function copy(string $tmpDir, string $file): string |
88 | 88 | { |
89 | 89 | $source = ltrim($this->files->relativePath($file, $tmpDir), '\\/'); |
90 | - if (strpos($source, $this->baseNamespace) === 0) { |
|
90 | + if (strpos($source, $this->baseNamespace) === 0){ |
|
91 | 91 | $source = ltrim(substr($source, strlen($this->baseNamespace)), '\\/'); |
92 | 92 | } |
93 | 93 | |
94 | - $target = $this->files->normalizePath($this->basePath . '/' . $source); |
|
94 | + $target = $this->files->normalizePath($this->basePath.'/'.$source); |
|
95 | 95 | |
96 | 96 | $this->files->ensureDirectory(dirname($target)); |
97 | 97 | $this->files->copy($file, $target); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | */ |
105 | 105 | private function tmpDir(): string |
106 | 106 | { |
107 | - $directory = sys_get_temp_dir() . '/' . spl_object_hash($this); |
|
107 | + $directory = sys_get_temp_dir().'/'.spl_object_hash($this); |
|
108 | 108 | $this->files->ensureDirectory($directory); |
109 | 109 | |
110 | 110 | return $this->files->normalizePath($directory, true); |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | { |
121 | 121 | return array_filter( |
122 | 122 | $this->files->getFiles(dirname($protoFile)), |
123 | - function ($file) { |
|
123 | + function ($file){ |
|
124 | 124 | return strpos($file, '.proto') !== false; |
125 | 125 | } |
126 | 126 | ); |
@@ -63,14 +63,16 @@ discard block |
||
63 | 63 | |
64 | 64 | $output = trim(join("\n", $output), "\n ,"); |
65 | 65 | |
66 | - if ($output !== '') { |
|
66 | + if ($output !== '') |
|
67 | + { |
|
67 | 68 | $this->files->deleteDirectory($tmpDir); |
68 | 69 | throw new CompileException($output); |
69 | 70 | } |
70 | 71 | |
71 | 72 | // copying files (using relative path and namespace) |
72 | 73 | $result = []; |
73 | - foreach ($this->files->getFiles($tmpDir) as $file) { |
|
74 | + foreach ($this->files->getFiles($tmpDir) as $file) |
|
75 | + { |
|
74 | 76 | $result[] = $this->copy($tmpDir, $file); |
75 | 77 | } |
76 | 78 | |
@@ -87,7 +89,8 @@ discard block |
||
87 | 89 | private function copy(string $tmpDir, string $file): string |
88 | 90 | { |
89 | 91 | $source = ltrim($this->files->relativePath($file, $tmpDir), '\\/'); |
90 | - if (strpos($source, $this->baseNamespace) === 0) { |
|
92 | + if (strpos($source, $this->baseNamespace) === 0) |
|
93 | + { |
|
91 | 94 | $source = ltrim(substr($source, strlen($this->baseNamespace)), '\\/'); |
92 | 95 | } |
93 | 96 | |
@@ -120,7 +123,8 @@ discard block |
||
120 | 123 | { |
121 | 124 | return array_filter( |
122 | 125 | $this->files->getFiles(dirname($protoFile)), |
123 | - function ($file) { |
|
126 | + function ($file) |
|
127 | + { |
|
124 | 128 | return strpos($file, '.proto') !== false; |
125 | 129 | } |
126 | 130 | ); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $parameters->set(Option::PACKAGE_ALIAS_FORMAT, '<major>.<minor>.x-dev'); |
37 | 37 | |
38 | 38 | $parameters->set(Option::PACKAGE_DIRECTORIES, [ |
39 | - __DIR__ . '/src' |
|
39 | + __DIR__.'/src' |
|
40 | 40 | ]); |
41 | 41 | |
42 | 42 | $parameters->set(Option::DATA_TO_APPEND, [ |
@@ -100,6 +100,6 @@ discard block |
||
100 | 100 | ]); |
101 | 101 | |
102 | 102 | $parameters->set(Option::DIRECTORIES_TO_REPOSITORIES, [ |
103 | - __DIR__ . '/src/Core' => '[email protected]:spiral/core.git' |
|
103 | + __DIR__.'/src/Core' => '[email protected]:spiral/core.git' |
|
104 | 104 | ]); |
105 | 105 | }; |