@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | * Convert string into integer |
| 47 | 47 | * Must be precise number, otherwise you will see and exception. |
| 48 | 48 | * |
| 49 | - * @param $valueAsString |
|
| 49 | + * @param string $valueAsString |
|
| 50 | 50 | * @return BigInteger |
| 51 | 51 | * @throws Exception |
| 52 | 52 | */ |
@@ -65,6 +65,9 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | + /** |
|
| 69 | + * @param string $path |
|
| 70 | + */ |
|
| 68 | 71 | private function getFileSizeWindows($path) |
| 69 | 72 | { |
| 70 | 73 | $escapedPath = escapeshellarg($path); |
@@ -73,6 +76,9 @@ discard block |
||
| 73 | 76 | ); |
| 74 | 77 | } |
| 75 | 78 | |
| 79 | + /** |
|
| 80 | + * @param string $path |
|
| 81 | + */ |
|
| 76 | 82 | private function getFileSizeLinux($path) |
| 77 | 83 | { |
| 78 | 84 | $escapedPath = escapeshellarg($path); |
@@ -81,6 +87,9 @@ discard block |
||
| 81 | 87 | ); |
| 82 | 88 | } |
| 83 | 89 | |
| 90 | + /** |
|
| 91 | + * @param string $path |
|
| 92 | + */ |
|
| 84 | 93 | private function getFileSizeMac($path) |
| 85 | 94 | { |
| 86 | 95 | $escapedPath = escapeshellarg($path); |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | throw new PrerequisiteException("Exec function is disabled"); |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - if(strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { |
|
| 20 | + if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { |
|
| 21 | 21 | $this->os = self::OS_WINDOWS; |
| 22 | 22 | } elseif (strtoupper(PHP_OS) == "DARWIN") { |
| 23 | 23 | $this->os = self::OS_MAC; |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function getFileSize($path) |
| 36 | 36 | { |
| 37 | - switch($this->os) { |
|
| 37 | + switch ($this->os) { |
|
| 38 | 38 | case self::OS_WINDOWS: return $this->getFileSizeWindows($path); break; |
| 39 | 39 | case self::OS_LINUX: return $this->getFileSizeLinux($path); break; |
| 40 | 40 | case self::OS_MAC: return $this->getFileSizeMac($path); break; |
@@ -51,8 +51,8 @@ discard block |
||
| 51 | 51 | * @throws Exception |
| 52 | 52 | */ |
| 53 | 53 | private function convertToInteger($valueAsString) { |
| 54 | - if(!is_string($valueAsString)) { |
|
| 55 | - throw new Exception("Cannot convert to integer. Expected string, but got " . gettype($valueAsString). "."); |
|
| 54 | + if (!is_string($valueAsString)) { |
|
| 55 | + throw new Exception("Cannot convert to integer. Expected string, but got " . gettype($valueAsString) . "."); |
|
| 56 | 56 | } |
| 57 | 57 | $trimmedInput = trim($valueAsString); |
| 58 | 58 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | return BigInteger::of($trimmedInput); |
| 61 | 61 | |
| 62 | 62 | } catch (ArithmeticException $e) { |
| 63 | - throw new Exception("Returned value cannot be converted to an integer.",0, $e); |
|
| 63 | + throw new Exception("Returned value cannot be converted to an integer.", 0, $e); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | } |