@@ -31,39 +31,39 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | trait RotationTrait { |
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * @var string |
|
| 36 | - * @since 14.0.0 |
|
| 37 | - */ |
|
| 38 | - protected $filePath; |
|
| 34 | + /** |
|
| 35 | + * @var string |
|
| 36 | + * @since 14.0.0 |
|
| 37 | + */ |
|
| 38 | + protected $filePath; |
|
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * @var int |
|
| 42 | - * @since 14.0.0 |
|
| 43 | - */ |
|
| 44 | - protected $maxSize; |
|
| 40 | + /** |
|
| 41 | + * @var int |
|
| 42 | + * @since 14.0.0 |
|
| 43 | + */ |
|
| 44 | + protected $maxSize; |
|
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * @return string the resulting new filepath |
|
| 48 | - * @since 14.0.0 |
|
| 49 | - */ |
|
| 50 | - protected function rotate():string { |
|
| 51 | - $rotatedFile = $this->filePath.'.1'; |
|
| 52 | - rename($this->filePath, $rotatedFile); |
|
| 53 | - return $rotatedFile; |
|
| 54 | - } |
|
| 46 | + /** |
|
| 47 | + * @return string the resulting new filepath |
|
| 48 | + * @since 14.0.0 |
|
| 49 | + */ |
|
| 50 | + protected function rotate():string { |
|
| 51 | + $rotatedFile = $this->filePath.'.1'; |
|
| 52 | + rename($this->filePath, $rotatedFile); |
|
| 53 | + return $rotatedFile; |
|
| 54 | + } |
|
| 55 | 55 | |
| 56 | - /** |
|
| 57 | - * @return bool |
|
| 58 | - * @since 14.0.0 |
|
| 59 | - */ |
|
| 60 | - protected function shouldRotateBySize():bool { |
|
| 61 | - if ((int)$this->maxSize > 0 && file_exists($this->filePath)) { |
|
| 62 | - $filesize = @filesize($this->filePath); |
|
| 63 | - if ($filesize >= (int)$this->maxSize) { |
|
| 64 | - return true; |
|
| 65 | - } |
|
| 66 | - } |
|
| 67 | - return false; |
|
| 68 | - } |
|
| 56 | + /** |
|
| 57 | + * @return bool |
|
| 58 | + * @since 14.0.0 |
|
| 59 | + */ |
|
| 60 | + protected function shouldRotateBySize():bool { |
|
| 61 | + if ((int)$this->maxSize > 0 && file_exists($this->filePath)) { |
|
| 62 | + $filesize = @filesize($this->filePath); |
|
| 63 | + if ($filesize >= (int)$this->maxSize) { |
|
| 64 | + return true; |
|
| 65 | + } |
|
| 66 | + } |
|
| 67 | + return false; |
|
| 68 | + } |
|
| 69 | 69 | } |
@@ -58,9 +58,9 @@ |
||
| 58 | 58 | * @since 14.0.0 |
| 59 | 59 | */ |
| 60 | 60 | protected function shouldRotateBySize():bool { |
| 61 | - if ((int)$this->maxSize > 0 && file_exists($this->filePath)) { |
|
| 61 | + if ((int) $this->maxSize > 0 && file_exists($this->filePath)) { |
|
| 62 | 62 | $filesize = @filesize($this->filePath); |
| 63 | - if ($filesize >= (int)$this->maxSize) { |
|
| 63 | + if ($filesize >= (int) $this->maxSize) { |
|
| 64 | 64 | return true; |
| 65 | 65 | } |
| 66 | 66 | } |