@@ -14,7 +14,7 @@ |
||
14 | 14 | * @param callable $callable |
15 | 15 | * @return self |
16 | 16 | */ |
17 | - public function catch(callable $callable): self |
|
17 | + public function catch (callable $callable): self |
|
18 | 18 | { |
19 | 19 | $this->catchCallable = $callable; |
20 | 20 |
@@ -38,7 +38,7 @@ |
||
38 | 38 | return "{$this->fileOriginal}.{$number}{$this->suffix}"; |
39 | 39 | } |
40 | 40 | |
41 | - if ($this->maxFiles > 0 && $number >= $this->maxFiles ) { |
|
41 | + if ($this->maxFiles > 0 && $number >= $this->maxFiles) { |
|
42 | 42 | if (file_exists($file)) { |
43 | 43 | unlink($file); |
44 | 44 | } |
@@ -20,13 +20,13 @@ |
||
20 | 20 | |
21 | 21 | $gz = gzopen($fileCompress, 'wb'); |
22 | 22 | |
23 | - if (! $gz) { |
|
23 | + if (!$gz) { |
|
24 | 24 | fclose($fd); |
25 | 25 | |
26 | 26 | throw new Exception("file {$fileCompress} not can open.", 101); |
27 | 27 | } |
28 | 28 | |
29 | - while (! feof($fd)) { |
|
29 | + while (!feof($fd)) { |
|
30 | 30 | gzwrite($gz, fread($fd, 1024 * 512)); |
31 | 31 | } |
32 | 32 |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | call_user_func($this->thenCallback, $fileRotated); |
122 | 122 | } |
123 | 123 | |
124 | - return ! empty($fileRotated); |
|
124 | + return !empty($fileRotated); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | private function canRotate(string $file): bool |
154 | 154 | { |
155 | - if (! $this->fileIsValid($file)) { |
|
155 | + if (!$this->fileIsValid($file)) { |
|
156 | 156 | $this->exception( |
157 | 157 | new Exception(sprintf('the file %s not is valid.', $file), 10) |
158 | 158 | ); |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | |
200 | 200 | $fd = fopen($file, 'r+'); |
201 | 201 | |
202 | - if (! $fd) { |
|
202 | + if (!$fd) { |
|
203 | 203 | $this->exception( |
204 | 204 | new Exception(sprintf('the file %s not can open.', $file), 20) |
205 | 205 | ); |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | return null; |
208 | 208 | } |
209 | 209 | |
210 | - if (! flock($fd, LOCK_EX)) { |
|
210 | + if (!flock($fd, LOCK_EX)) { |
|
211 | 211 | fclose($fd); |
212 | 212 | |
213 | 213 | $this->exception( |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | return null; |
218 | 218 | } |
219 | 219 | |
220 | - if (! copy($file, $fileDestination)) { |
|
220 | + if (!copy($file, $fileDestination)) { |
|
221 | 221 | fclose($fd); |
222 | 222 | |
223 | 223 | $this->exception( |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | return null; |
231 | 231 | } |
232 | 232 | |
233 | - if (! ftruncate($fd, 0)) { |
|
233 | + if (!ftruncate($fd, 0)) { |
|
234 | 234 | fclose($fd); |
235 | 235 | |
236 | 236 | unlink($fileDestination); |