1 | <?php |
||
7 | class ExecDriver implements ISizeDriver |
||
8 | { |
||
9 | private $os; |
||
10 | const OS_WINDOWS = "Windows"; |
||
11 | const OS_LINUX = "Linux"; |
||
12 | const OS_MAC = "Mac"; |
||
13 | |||
14 | public function __construct() |
||
28 | |||
29 | /** |
||
30 | * Returns file size by using system shell/cmd commands |
||
31 | * @inheritdoc |
||
32 | * @link http://stackoverflow.com/questions/5501451/php-x86-how-to-get-filesize-of-2gb-file-without-external-program/5502328#5502328 |
||
33 | * @return BigInteger |
||
34 | */ |
||
35 | public function getFileSize($path) |
||
44 | |||
45 | /** |
||
46 | * Convert string into integer |
||
47 | * Must be precise number, otherwise you will see and exception. |
||
48 | * |
||
49 | * @param $valueAsString |
||
50 | * @return BigInteger |
||
51 | * @throws Exception |
||
52 | */ |
||
53 | private function convertToInteger($valueAsString) { |
||
67 | |||
68 | private function getFileSizeWindows($path) |
||
75 | |||
76 | private function getFileSizeLinux($path) |
||
83 | |||
84 | private function getFileSizeMac($path) |
||
91 | } |
The break statement is not necessary if it is preceded for example by a return statement:
If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.