@@ -59,9 +59,9 @@ discard block |
||
| 59 | 59 | foreach ($typeDrivers as $typeDriverClass => $typeDriverConfig) { |
| 60 | 60 | $type_messages = []; |
| 61 | 61 | if ($typeDriverConfig[1]) { |
| 62 | - $type_messages[] = '<info>' . $typeDriverClass . '</info>: ' . $typeDriverConfig[0]; |
|
| 62 | + $type_messages[] = '<info>'.$typeDriverClass.'</info>: '.$typeDriverConfig[0]; |
|
| 63 | 63 | } else { |
| 64 | - $type_messages[] = '<error>' . $typeDriverClass . '</error>: ' . $typeDriverConfig[0]; |
|
| 64 | + $type_messages[] = '<error>'.$typeDriverClass.'</error>: '.$typeDriverConfig[0]; |
|
| 65 | 65 | $type_messages[] = $this->formatInstallation($typeDriverConfig[2], 4); |
| 66 | 66 | } |
| 67 | 67 | $output->writeln($formatter->formatSection( |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | protected function formatInstallation($doc, $leftPadding = 4) |
| 85 | 85 | { |
| 86 | 86 | return implode("\n", array_map( |
| 87 | - function($line) use ($leftPadding) { return str_repeat(' ', $leftPadding) . $line; }, |
|
| 87 | + function($line) use ($leftPadding) { return str_repeat(' ', $leftPadding).$line; }, |
|
| 88 | 88 | explode( |
| 89 | 89 | "\n", |
| 90 | 90 | preg_replace('~`(.+?)`~', '<options=bold,underscore>$1</>', $doc) |
@@ -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 / driver'); |
| 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; |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | public static function getInstallationInstruction() |
| 60 | 60 | { |
| 61 | - return 'install library [pear/archive_tar]: `composer require pear/archive_tar`' . "\n" . ' and optionally php-extensions (zlib, bz2)'; |
|
| 61 | + return 'install library [pear/archive_tar]: `composer require pear/archive_tar`'."\n".' and optionally php-extensions (zlib, bz2)'; |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | $compression = 'lzma2'; |
| 166 | 166 | break; |
| 167 | 167 | case 'z': |
| 168 | - $tar_aname = 'compress.lzw://' . $archiveFileName; |
|
| 168 | + $tar_aname = 'compress.lzw://'.$archiveFileName; |
|
| 169 | 169 | break; |
| 170 | 170 | } |
| 171 | 171 | |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | |
| 223 | 223 | case Formats::TAR_LZW: |
| 224 | 224 | LzwStreamWrapper::registerWrapper(); |
| 225 | - $this->tar = new Archive_Tar('compress.lzw://' . $this->archiveFileName); |
|
| 225 | + $this->tar = new Archive_Tar('compress.lzw://'.$this->archiveFileName); |
|
| 226 | 226 | break; |
| 227 | 227 | |
| 228 | 228 | default: |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | |
| 29 | 29 | public static function getDescription() |
| 30 | 30 | { |
| 31 | - return 'adapter for ext-zip'.(extension_loaded('zip') && defined('\ZipArchive::LIBZIP_VERSION') ? ' ('. ZipArchive::LIBZIP_VERSION.')' : null); |
|
| 31 | + return 'adapter for ext-zip'.(extension_loaded('zip') && defined('\ZipArchive::LIBZIP_VERSION') ? ' ('.ZipArchive::LIBZIP_VERSION.')' : null); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | public static function isInstalled() |
@@ -68,9 +68,9 @@ discard block |
||
| 68 | 68 | public static function getInstallationInstruction() |
| 69 | 69 | { |
| 70 | 70 | self::init(); |
| 71 | - return 'install library [alchemy/zippy]: `composer require alchemy/zippy`' . "\n" . ' and console programs (tar, zip): `apt install tar zip` - depends on OS' |
|
| 72 | - . "\n" . 'If you install SevenZip and AlchemyZippy:' . "\n" . |
|
| 73 | - '1. You should specify symfony/console version before installation to any **3.x.x version**: `composer require symfony/process:~3.4`, because they require different `symfony/process` versions.' . "\n" . |
|
| 71 | + return 'install library [alchemy/zippy]: `composer require alchemy/zippy`'."\n".' and console programs (tar, zip): `apt install tar zip` - depends on OS' |
|
| 72 | + . "\n".'If you install SevenZip and AlchemyZippy:'."\n". |
|
| 73 | + '1. You should specify symfony/console version before installation to any **3.x.x version**: `composer require symfony/process:~3.4`, because they require different `symfony/process` versions.'."\n". |
|
| 74 | 74 | '2. Install archive7z version 4.0.0: `composer require gemorroj/archive7z:~4.0`'; |
| 75 | 75 | } |
| 76 | 76 | |
@@ -196,8 +196,8 @@ discard block |
||
| 196 | 196 | |
| 197 | 197 | $this->files[] = $information->files[] = str_replace('\\', '/', $member->getLocation()); |
| 198 | 198 | $this->members[str_replace('\\', '/', $member->getLocation())] = $member; |
| 199 | - $information->compressedFilesSize += (int)$member->getSize(); |
|
| 200 | - $information->uncompressedFilesSize += (int)$member->getSize(); |
|
| 199 | + $information->compressedFilesSize += (int) $member->getSize(); |
|
| 200 | + $information->uncompressedFilesSize += (int) $member->getSize(); |
|
| 201 | 201 | } |
| 202 | 202 | return $information; |
| 203 | 203 | } |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | public function getFileContent($fileName) |
| 247 | 247 | { |
| 248 | 248 | $member = $this->getMember($fileName); |
| 249 | - return (string)$member; |
|
| 249 | + return (string) $member; |
|
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | /** |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | public function getFileStream($fileName) |
| 256 | 256 | { |
| 257 | 257 | $member = $this->getMember($fileName); |
| 258 | - return self::wrapStringInStream((string)$member); |
|
| 258 | + return self::wrapStringInStream((string) $member); |
|
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | /** |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | public static function getDescription() |
| 24 | 24 | { |
| 25 | - return 'adapter for ext-rar' . (self::isInstalled() ? ' (' . phpversion('rar') . ')' : null); |
|
| 25 | + return 'adapter for ext-rar'.(self::isInstalled() ? ' ('.phpversion('rar').')' : null); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | public static function isInstalled() |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public static function getInstallationInstruction() |
| 37 | 37 | { |
| 38 | - return 'install [rar] extension.' . "\n" . 'Can be installed with pecl: `pecl install rar`'; |
|
| 38 | + return 'install [rar] extension.'."\n".'Can be installed with pecl: `pecl install rar`'; |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | */ |
| 14 | 14 | class Lzma extends OneFileDriver |
| 15 | 15 | { |
| 16 | - const FORMAT_SUFFIX = 'xz'; |
|
| 16 | + const FORMAT_SUFFIX = 'xz'; |
|
| 17 | 17 | const PHP_EXTENSION = 'xz'; |
| 18 | 18 | const FORMAT = Formats::LZMA; |
| 19 | 19 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | public static function getInstallationInstruction() |
| 32 | 32 | { |
| 33 | - return 'install [xz] extension' . "\n" . 'For 5.x: https://github.com/payden/php-xz' . "\n" . 'For 7.x: https://github.com/codemasher/php-ext-xz'; |
|
| 33 | + return 'install [xz] extension'."\n".'For 5.x: https://github.com/payden/php-xz'."\n".'For 7.x: https://github.com/codemasher/php-ext-xz'; |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | |
| 8 | 8 | class Bzip extends OneFileDriver |
| 9 | 9 | { |
| 10 | - const FORMAT_SUFFIX = 'bz2'; |
|
| 10 | + const FORMAT_SUFFIX = 'bz2'; |
|
| 11 | 11 | const PHP_EXTENSION = 'bz2'; |
| 12 | 12 | const FORMAT = Formats::BZIP; |
| 13 | 13 | |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | |
| 32 | 32 | public static function getInstallationInstruction() |
| 33 | 33 | { |
| 34 | - return 'install `' . static::PHP_EXTENSION . '` extension'; |
|
| 34 | + return 'install `'.static::PHP_EXTENSION.'` extension'; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | public static function getSupportedFormats() |