From 2fef65c21ca2ba97c5be9172de8ca8c9a335fcd7 Mon Sep 17 00:00:00 2001 From: overtrue Date: Mon, 31 Oct 2016 12:25:53 +0800 Subject: [PATCH] Fix configuration. --- src/Command/LintCommand.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Command/LintCommand.php b/src/Command/LintCommand.php index 26ab990f..ca7233d0 100644 --- a/src/Command/LintCommand.php +++ b/src/Command/LintCommand.php @@ -248,7 +248,11 @@ protected function mergeOptions() if (!empty($options['configuration'])) { $this->output->writeln("Loaded config from \"{$options['configuration']}\"\n"); $config = $this->loadConfiguration($options['configuration']); + } else { + $this->output->writeln("No config file loaded.\n"); } + } else { + $this->output->writeln("No config file loaded.\n"); } $options = array_merge($this->defaults, array_filter($config), array_filter($options)); @@ -270,7 +274,7 @@ protected function getConfigFile() $dir = './'; if (count($inputPath) == 1 && $first = reset($inputPath)) { - $dir = is_dir($first) ? : dirname($first); + $dir = is_dir($first) ? $first : dirname($first); } $filename = rtrim($dir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'.phplint.yml';