@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | public static function open($fileName, $password = null, $abilities = []) |
64 | 64 | { |
65 | 65 | if (!file_exists($fileName) || !is_readable($fileName)) { |
66 | - throw new InvalidArgumentException('Could not open file: ' . $fileName.' is not readable'); |
|
66 | + throw new InvalidArgumentException('Could not open file: '.$fileName.' is not readable'); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | $format = Formats::detectArchiveFormat($fileName); |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | public function getFileData($fileName) |
279 | 279 | { |
280 | 280 | if (!in_array($fileName, $this->files, true)) { |
281 | - throw new NonExistentArchiveFileException('File ' . $fileName . ' does not exist in archive'); |
|
281 | + throw new NonExistentArchiveFileException('File '.$fileName.' does not exist in archive'); |
|
282 | 282 | } |
283 | 283 | |
284 | 284 | return $this->archive->getFileData($fileName); |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | public function getFileContent($fileName) |
295 | 295 | { |
296 | 296 | if (!in_array($fileName, $this->files, true)) { |
297 | - throw new NonExistentArchiveFileException('File ' . $fileName . ' does not exist in archive'); |
|
297 | + throw new NonExistentArchiveFileException('File '.$fileName.' does not exist in archive'); |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | return $this->archive->getFileContent($fileName); |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | public function getFileStream($fileName) |
311 | 311 | { |
312 | 312 | if (!in_array($fileName, $this->files, true)) { |
313 | - throw new NonExistentArchiveFileException('File ' . $fileName . ' does not exist in archive'); |
|
313 | + throw new NonExistentArchiveFileException('File '.$fileName.' does not exist in archive'); |
|
314 | 314 | } |
315 | 315 | |
316 | 316 | return $this->archive->getFileStream($fileName); |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | /** @var BasicDriver $driver */ |
574 | 574 | $driver = Formats::getFormatDriver($info['type'], $abilities); |
575 | 575 | if ($driver === null) { |
576 | - throw new UnsupportedArchiveException('Unsupported archive type: ' . $info['type'] . ' of archive '); |
|
576 | + throw new UnsupportedArchiveException('Unsupported archive type: '.$info['type'].' of archive '); |
|
577 | 577 | } |
578 | 578 | |
579 | 579 | return $driver::createArchive( |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | public static function archiveFile($file, $archiveName, $compressionLevel = BasicDriver::COMPRESSION_AVERAGE, $password = null) |
601 | 601 | { |
602 | 602 | if (!is_file($file)) { |
603 | - throw new InvalidArgumentException($file . ' is not a valid file to archive'); |
|
603 | + throw new InvalidArgumentException($file.' is not a valid file to archive'); |
|
604 | 604 | } |
605 | 605 | |
606 | 606 | return static::archiveFiles($file, $archiveName, $compressionLevel, $password) === 1; |
@@ -671,8 +671,8 @@ discard block |
||
671 | 671 | if (is_array($source)) { |
672 | 672 | foreach ($source as $sourceItem) { |
673 | 673 | static::importFilesFromDir( |
674 | - rtrim($sourceItem, '/\\*') . '/*', |
|
675 | - !empty($destination) ? $destination . '/' : null, |
|
674 | + rtrim($sourceItem, '/\\*').'/*', |
|
675 | + !empty($destination) ? $destination.'/' : null, |
|
676 | 676 | true, |
677 | 677 | $files |
678 | 678 | ); |
@@ -680,8 +680,8 @@ discard block |
||
680 | 680 | } else if (is_dir($source)) { |
681 | 681 | // one source for directories |
682 | 682 | static::importFilesFromDir( |
683 | - rtrim($source, '/\\*') . '/*', |
|
684 | - !empty($destination) ? $destination . '/' : null, |
|
683 | + rtrim($source, '/\\*').'/*', |
|
684 | + !empty($destination) ? $destination.'/' : null, |
|
685 | 685 | true, |
686 | 686 | $files |
687 | 687 | ); |
@@ -33,19 +33,19 @@ discard block |
||
33 | 33 | |
34 | 34 | if ($driver !== null) { |
35 | 35 | if (strpos($driver, '\\') === false) { |
36 | - if (class_exists('\\wapmorgan\\UnifiedArchive\\Drivers\\' . $driver)) { |
|
37 | - $driver = '\\wapmorgan\\UnifiedArchive\\Drivers\\' . $driver; |
|
38 | - } else if (class_exists('\\wapmorgan\\UnifiedArchive\\Drivers\\OneFile\\' . $driver)) { |
|
39 | - $driver = '\\wapmorgan\\UnifiedArchive\\Drivers\\OneFile\\' . $driver; |
|
36 | + if (class_exists('\\wapmorgan\\UnifiedArchive\\Drivers\\'.$driver)) { |
|
37 | + $driver = '\\wapmorgan\\UnifiedArchive\\Drivers\\'.$driver; |
|
38 | + } else if (class_exists('\\wapmorgan\\UnifiedArchive\\Drivers\\OneFile\\'.$driver)) { |
|
39 | + $driver = '\\wapmorgan\\UnifiedArchive\\Drivers\\OneFile\\'.$driver; |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | if ($driver[0] !== '\\') { |
43 | 43 | $driver = '\\'.$driver; |
44 | 44 | } |
45 | 45 | if (!class_exists($driver) || !is_a($driver, BasicDriver::class, true)) { |
46 | - throw new \InvalidArgumentException('Class "' . $driver . '" not found or not in BasicDriver children'); |
|
46 | + throw new \InvalidArgumentException('Class "'.$driver.'" not found or not in BasicDriver children'); |
|
47 | 47 | } |
48 | - $output->writeln('Supported formats by <info>' . $driver . '</info>'); |
|
48 | + $output->writeln('Supported formats by <info>'.$driver.'</info>'); |
|
49 | 49 | |
50 | 50 | $table->setHeaders(['format', ...array_keys(self::$abilitiesLabels)]); |
51 | 51 | foreach ($driver::getSupportedFormats() as $i => $format) { |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | return 0; |
63 | 63 | } |
64 | 64 | |
65 | - $headers = array_map(function ($v) { return substr($v, strrpos($v, '\\') + 1);}, Formats::$drivers); |
|
65 | + $headers = array_map(function($v) { return substr($v, strrpos($v, '\\') + 1); }, Formats::$drivers); |
|
66 | 66 | array_unshift($headers, 'format'); |
67 | 67 | |
68 | 68 | $table->setHeaders($headers); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $table->render(); |
89 | 89 | |
90 | 90 | foreach (array_combine(array_values(self::$abilitiesShortCuts), array_keys(self::$abilitiesLabels)) as $shortCut => $label) { |
91 | - $output->writeln('<info>' . $shortCut . '</info> - ' . $label); |
|
91 | + $output->writeln('<info>'.$shortCut.'</info> - '.$label); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | return 0; |