diff --git a/README.md b/README.md index 85e08995..ced0ef79 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ Options: -c, --configuration=CONFIGURATION Read configuration from config file (default: ./.phplint.yml). --no-configuration Ignore default configuration file (default: ./.phplint.yml). --no-cache Ignore cached data. + --cache=CACHE Path to the cache file. -h, --help Display this help message -q, --quiet Do not output any message -V, --version Display this application version @@ -56,6 +57,7 @@ You can also define configuration as a file `.phplint.yml`: ```yaml path: ./ jobs: 10 +cache: build/phplint.cache extensions: - php exclude: @@ -102,4 +104,3 @@ $errors = $linter->lint(); ## License MIT - diff --git a/src/Command/LintCommand.php b/src/Command/LintCommand.php index 38429503..f592378f 100644 --- a/src/Command/LintCommand.php +++ b/src/Command/LintCommand.php @@ -154,8 +154,8 @@ protected function execute(InputInterface $input, OutputInterface $output) $linter = new Linter($options['path'], $options['exclude'], $options['extensions']); $linter->setProcessLimit($options['jobs']); - if (null !== $input->getOption('cache')) { - Cache::setFilename($input->getOption('cache')); + if ($options['cache']) { + Cache::setFilename($options['cache']); } $usingCache = 'No'; @@ -261,6 +261,7 @@ protected function mergeOptions() { $options = $this->input->getOptions(); $options['path'] = $this->input->getArgument('path'); + $options['cache'] = $this->input->getOption('cache'); $config = []; diff --git a/src/Process/Lint.php b/src/Process/Lint.php index 60699bc9..0502c967 100644 --- a/src/Process/Lint.php +++ b/src/Process/Lint.php @@ -33,7 +33,7 @@ public function hasSyntaxError() } /** - * @return bool|string + * @return bool|array */ public function getSyntaxError() {