@@ -237,8 +237,8 @@ |
||
237 | 237 | if ($code == 0 || $code == 2 || is_null($code)) { |
238 | 238 | // rewrite original file |
239 | 239 | if (rename($this->tmp2, $this->path) !== true) { |
240 | - throw new \RuntimeException(__FILE__ . ', line ' . __LINE__ . |
|
241 | - ': Could not replace original file ' . $this->path); |
|
240 | + throw new \RuntimeException(__FILE__.', line '.__LINE__. |
|
241 | + ': Could not replace original file '.$this->path); |
|
242 | 242 | } |
243 | 243 | } else { |
244 | 244 | throw new \RuntimeException(__FILE__.', line '.__LINE__. |
@@ -15,7 +15,7 @@ |
||
15 | 15 | { |
16 | 16 | $fp = fopen($file, 'rb'); |
17 | 17 | if (filesize($file) < 18 || strcmp(fread($fp, 2), "\x1f\x8b")) { |
18 | - return false; // Not GZIP format (See RFC 1952) |
|
18 | + return false; // Not GZIP format (See RFC 1952) |
|
19 | 19 | } |
20 | 20 | $method = fread($fp, 1); |
21 | 21 | $flags = fread($fp, 1); |
@@ -29,7 +29,7 @@ |
||
29 | 29 | } |
30 | 30 | |
31 | 31 | if (!empty($previous_comment = $archive->getComment())) { |
32 | - $output->writeln('Comment "' . $previous_comment . '" replaced', OutputInterface::OUTPUT_RAW); |
|
32 | + $output->writeln('Comment "'.$previous_comment.'" replaced', OutputInterface::OUTPUT_RAW); |
|
33 | 33 | } else if ($comment === null) { |
34 | 34 | $output->writeln('Comment deleted', OutputInterface::OUTPUT_RAW); |
35 | 35 | } else { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | if (empty($destination)) { |
49 | 49 | throw new \LogicException('Source and destination can not be empty'); |
50 | 50 | } |
51 | - $output->writeln('<info>Read ' . $data_size . ' from input</info>'); |
|
51 | + $output->writeln('<info>Read '.$data_size.' from input</info>'); |
|
52 | 52 | } else { |
53 | 53 | $data_size = filesize($source); |
54 | 54 | } |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | } |
76 | 76 | if ($added_files === 1) { |
77 | 77 | $details = $archive->getFileData($destination); |
78 | - $output->writeln('Added <comment>' . $source . '</comment>(' |
|
79 | - . implode($this->formatSize($data_size)) . ') as ' |
|
80 | - . $destination . ' (' |
|
78 | + $output->writeln('Added <comment>'.$source.'</comment>(' |
|
79 | + . implode($this->formatSize($data_size)).') as ' |
|
80 | + . $destination.' (' |
|
81 | 81 | . implode($this->formatSize($details->compressedSize)) |
82 | 82 | . ')'); |
83 | 83 | } |
@@ -31,18 +31,18 @@ |
||
31 | 31 | $detect_mimetype = $input->getOption('detect-mimetype'); |
32 | 32 | |
33 | 33 | $details = $archive->getFileData($file); |
34 | - $output->writeln('File <info>' . $file . '</info>'); |
|
34 | + $output->writeln('File <info>'.$file.'</info>'); |
|
35 | 35 | if ($detect_mimetype) { |
36 | - $output->writeln('Mime type: <info>' . $this->getMimeTypeByStream($archive->getFileStream($file)).'</info>'); |
|
36 | + $output->writeln('Mime type: <info>'.$this->getMimeTypeByStream($archive->getFileStream($file)).'</info>'); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | $output->writeln('Size:'); |
40 | - $output->writeln("\t". 'uncompressed: '.implode(' ', $this->formatSize($details->uncompressedSize, 2))); |
|
41 | - $output->writeln("\t" . 'compressed: ' . implode(' ', $this->formatSize($details->compressedSize, 2))); |
|
42 | - $output->writeln("\t" . 'ratio: <info>' . round($details->uncompressedSize / $details->compressedSize, 6) . '/1 (' . floor($details->compressedSize / $details->uncompressedSize * 100) . '%</info>)'); |
|
43 | - $output->writeln('Modificated: ' . $this->formatDate($details->modificationTime)); |
|
40 | + $output->writeln("\t".'uncompressed: '.implode(' ', $this->formatSize($details->uncompressedSize, 2))); |
|
41 | + $output->writeln("\t".'compressed: '.implode(' ', $this->formatSize($details->compressedSize, 2))); |
|
42 | + $output->writeln("\t".'ratio: <info>'.round($details->uncompressedSize / $details->compressedSize, 6).'/1 ('.floor($details->compressedSize / $details->uncompressedSize * 100).'%</info>)'); |
|
43 | + $output->writeln('Modificated: '.$this->formatDate($details->modificationTime)); |
|
44 | 44 | if (!empty($comment = $details->comment)) |
45 | - $output->writeln('Comment: <comment>' . $comment . '</comment>'); |
|
45 | + $output->writeln('Comment: <comment>'.$comment.'</comment>'); |
|
46 | 46 | |
47 | 47 | if (empty($input->getArgument('file'))) { |
48 | 48 | $helper = $this->getHelper('question'); |
@@ -88,7 +88,7 @@ |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | if ($sort !== null) { |
91 | - usort($rows, function (array $a, array $b) use ($sort_field) { |
|
91 | + usort($rows, function(array $a, array $b) use ($sort_field) { |
|
92 | 92 | if ($a[$sort_field] > $b[$sort_field]) { |
93 | 93 | return 1; |
94 | 94 | } |
@@ -37,9 +37,9 @@ |
||
37 | 37 | $question = new ChoiceQuestion('Which file', $files); |
38 | 38 | $file = $helper->ask($input, $output, $question); |
39 | 39 | } else if (!in_array($file, $files, true)) { |
40 | - throw new \InvalidArgumentException('File "' . $file . '" not found in archive'); |
|
40 | + throw new \InvalidArgumentException('File "'.$file.'" not found in archive'); |
|
41 | 41 | } |
42 | - $output->writeln('<comment>Selecting file ' . $file . '</comment>', OutputInterface::VERBOSITY_VERY_VERBOSE); |
|
42 | + $output->writeln('<comment>Selecting file '.$file.'</comment>', OutputInterface::VERBOSITY_VERY_VERBOSE); |
|
43 | 43 | |
44 | 44 | return [$archive, $file]; |
45 | 45 | } |
@@ -27,14 +27,14 @@ |
||
27 | 27 | list($archive, $file) = $this->getArchiveAndFile($input, $output); |
28 | 28 | $destination = $input->getArgument('destination'); |
29 | 29 | if (is_dir($destination)) { |
30 | - $destination = $destination . '/' . basename($file); |
|
30 | + $destination = $destination.'/'.basename($file); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | $overwrite = $input->getOption('overwrite'); |
34 | 34 | |
35 | 35 | if (file_exists($destination) && !$overwrite) { |
36 | 36 | if ($input->getOption('no-interaction')) { |
37 | - throw new \LogicException('File destination ' . $destination . ' exists'); |
|
37 | + throw new \LogicException('File destination '.$destination.' exists'); |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | public static function getInstallationInstruction() |
109 | 109 | { |
110 | 110 | if (!class_exists('\Archive7z\Archive7z')) |
111 | - return 'install library [gemorroj/archive7z]: `composer require gemorroj/archive7z`' . "\n" |
|
111 | + return 'install library [gemorroj/archive7z]: `composer require gemorroj/archive7z`'."\n" |
|
112 | 112 | . ' and console program p7zip [7za]: `apt install p7zip-full` - depends on OS'; |
113 | 113 | |
114 | 114 | if (Archive7z::getBinaryVersion() === false) |
@@ -150,8 +150,8 @@ discard block |
||
150 | 150 | $information->files[] = $can_get_unix_path |
151 | 151 | ? $entry->getUnixPath() |
152 | 152 | : str_replace('\\', '/', $entry->getPath()); |
153 | - $information->compressedFilesSize += (int)$entry->getPackedSize(); |
|
154 | - $information->uncompressedFilesSize += (int)$entry->getSize(); |
|
153 | + $information->compressedFilesSize += (int) $entry->getPackedSize(); |
|
154 | + $information->uncompressedFilesSize += (int) $entry->getSize(); |
|
155 | 155 | } |
156 | 156 | return $information; |
157 | 157 | } |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | { |
210 | 210 | $entry = $this->sevenZip->getEntry($fileName); |
211 | 211 | if ($entry === null) { |
212 | - throw new NonExistentArchiveFileException('File ' . $fileName . ' does not exist'); |
|
212 | + throw new NonExistentArchiveFileException('File '.$fileName.' does not exist'); |
|
213 | 213 | } |
214 | 214 | return $entry->getContent(); |
215 | 215 | } |