| @@ -11,14 +11,14 @@ | ||
| 11 | 11 | |
| 12 | 12 |          if (is_array(current($array))) { // with sections | 
| 13 | 13 |              foreach ($array as $section => $data) { | 
| 14 | - $ret.= PHP_EOL.PHP_EOL.self::section($section); | |
| 14 | + $ret .= PHP_EOL.PHP_EOL.self::section($section); | |
| 15 | 15 |                  foreach ($data as $key => $value) { | 
| 16 | - $ret.= PHP_EOL.self::line($key, $value); | |
| 16 | + $ret .= PHP_EOL.self::line($key, $value); | |
| 17 | 17 | } | 
| 18 | 18 | } | 
| 19 | 19 |          } else { // no section | 
| 20 | 20 |              foreach ($array as $key => $value) { | 
| 21 | - $ret.= self::line($key, $value); | |
| 21 | + $ret .= self::line($key, $value); | |
| 22 | 22 | } | 
| 23 | 23 | } | 
| 24 | 24 | |
| @@ -46,7 +46,7 @@ | ||
| 46 | 46 | $this->file = $res['basename']; | 
| 47 | 47 | $this->file_extension = $res['extension']; | 
| 48 | 48 | |
| 49 | - $this->already_parsed=true; | |
| 49 | + $this->already_parsed = true; | |
| 50 | 50 | } | 
| 51 | 51 | return $this; | 
| 52 | 52 | } | 
| @@ -23,7 +23,7 @@ discard block | ||
| 23 | 23 | return []; | 
| 24 | 24 | } | 
| 25 | 25 | |
| 26 | - $filenames = self::preg_scandir($this->root_path, $regex);// ID_SEQUENCENUMBER.ext | |
| 26 | + $filenames = self::preg_scandir($this->root_path, $regex); // ID_SEQUENCENUMBER.ext | |
| 27 | 27 |          if (!is_null($filenames)) { | 
| 28 | 28 | sort($filenames); | 
| 29 | 29 | } | 
| @@ -132,7 +132,7 @@ discard block | ||
| 132 | 132 | } | 
| 133 | 133 | |
| 134 | 134 |          if (($filenames = scandir($dir_path, SCANDIR_SORT_ASCENDING)) !== false) { | 
| 135 | - return is_null($regex)? $filenames : preg_grep($regex, $filenames); | |
| 135 | + return is_null($regex) ? $filenames : preg_grep($regex, $filenames); | |
| 136 | 136 | } | 
| 137 | 137 | |
| 138 | 138 |          throw new \Exception("directory path '$dir_path' cannot be scanned"); | 
| @@ -31,26 +31,26 @@ | ||
| 31 | 31 | $file_1 = new TextFile($filepath_1, 'r'); | 
| 32 | 32 | $file_2 = new TextFile($filepath_2, 'r'); | 
| 33 | 33 | |
| 34 | - if($file_1->size() ! $file_2->size()) | |
| 34 | + if ($file_1->size() !$file_2->size()) | |
| 35 | 35 | return false; | 
| 36 | 36 | |
| 37 | 37 | $filepointer_1 = $file_1->open(); | 
| 38 | 38 | $filepointer_2 = $file_2->open(); | 
| 39 | 39 | |
| 40 | 40 | $identical = true; | 
| 41 | - while(!feof($filepointer_1) && $identical === true) | |
| 41 | + while (!feof($filepointer_1) && $identical === true) | |
| 42 | 42 |          { | 
| 43 | 43 | $chunk_1 = fread($filepointer_1, $read_length); | 
| 44 | 44 | $chunk_2 = fread($filepointer_2, $read_length); | 
| 45 | 45 | |
| 46 | - if($chunk_1 === false || $chunk_2 === false) | |
| 46 | + if ($chunk_1 === false || $chunk_2 === false) | |
| 47 | 47 |            { | 
| 48 | 48 | $file_1->close(); | 
| 49 | 49 | $file_2->close(); | 
| 50 | 50 |              throw \RuntimeException('fread returned false'); | 
| 51 | 51 | } | 
| 52 | 52 | |
| 53 | - if($chunk_1 !== $chunk_2) | |
| 53 | + if ($chunk_1 !== $chunk_2) | |
| 54 | 54 | $identical = false; | 
| 55 | 55 | } | 
| 56 | 56 | |
| @@ -31,8 +31,9 @@ discard block | ||
| 31 | 31 | $file_1 = new TextFile($filepath_1, 'r'); | 
| 32 | 32 | $file_2 = new TextFile($filepath_2, 'r'); | 
| 33 | 33 | |
| 34 | - if($file_1->size() ! $file_2->size()) | |
| 35 | - return false; | |
| 34 | +        if($file_1->size() ! $file_2->size()) { | |
| 35 | + return false; | |
| 36 | + } | |
| 36 | 37 | |
| 37 | 38 | $filepointer_1 = $file_1->open(); | 
| 38 | 39 | $filepointer_2 = $file_2->open(); | 
| @@ -50,8 +51,9 @@ discard block | ||
| 50 | 51 |              throw \RuntimeException('fread returned false'); | 
| 51 | 52 | } | 
| 52 | 53 | |
| 53 | - if($chunk_1 !== $chunk_2) | |
| 54 | - $identical = false; | |
| 54 | +          if($chunk_1 !== $chunk_2) { | |
| 55 | + $identical = false; | |
| 56 | + } | |
| 55 | 57 | } | 
| 56 | 58 | |
| 57 | 59 | $file_1->close(); |