@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | $this->setName('highlight') |
37 | 37 | ->addArgument('path', InputArgument::REQUIRED | InputArgument::IS_ARRAY, 'File(s) to highlight') |
38 | - ->addOption('normalize', null, InputOption::VALUE_OPTIONAL, 'Normalize input to LF') |
|
38 | + ->addOption('normalize', null, InputOption::VALUE_OPTIONAL, 'Normalize input to LF') |
|
39 | 39 | ->addOption('language', 'l', InputOption::VALUE_OPTIONAL, 'Source Language to highlight, see <comment>list-languages</comment> command') |
40 | 40 | ->addOption('format', 'f', InputOption::VALUE_OPTIONAL, 'Output format, see <comment>list-languages</comment> command', 'cli') |
41 | 41 | ->addOption( |
@@ -48,26 +48,26 @@ discard block |
||
48 | 48 | |
49 | 49 | protected function execute(InputInterface $input, OutputInterface $output) |
50 | 50 | { |
51 | - if(!empty($input->getOption('debug')) && $output->getVerbosity() < OutputInterface::VERBOSITY_VERBOSE) { |
|
51 | + if (!empty($input->getOption('debug')) && $output->getVerbosity() < OutputInterface::VERBOSITY_VERBOSE) { |
|
52 | 52 | $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); |
53 | 53 | } |
54 | 54 | |
55 | 55 | $output->writeln($this->getApplication()->getLongVersion()."\n", Output::VERBOSITY_VERBOSE); |
56 | 56 | $formatter = KeyLighter::get()->getFormatter($input->getOption('format')) ?: KeyLighter::get()->getDefaultFormatter(); |
57 | 57 | |
58 | - foreach($input->getArgument('path') as $filename) { |
|
58 | + foreach ($input->getArgument('path') as $filename) { |
|
59 | 59 | $this->process($input, $output, $filename, $formatter); |
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
63 | 63 | protected function content($path, $normalize = false) |
64 | 64 | { |
65 | - if(!($file = @fopen($path, 'r'))) { |
|
65 | + if (!($file = @fopen($path, 'r'))) { |
|
66 | 66 | return false; |
67 | 67 | } |
68 | 68 | |
69 | 69 | $content = ''; |
70 | - while(!feof($file)) { |
|
70 | + while (!feof($file)) { |
|
71 | 71 | $content .= fgets($file); |
72 | 72 | } |
73 | 73 | fclose($file); |