From 86a0f41450880f5224b0939645ed557306e45233 Mon Sep 17 00:00:00 2001 From: Dejan Marjanovic Date: Thu, 24 Apr 2014 19:57:21 +0200 Subject: [PATCH] Fix $config(Dir|File) --- Symfony/CS/Console/Command/FixCommand.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Symfony/CS/Console/Command/FixCommand.php b/Symfony/CS/Console/Command/FixCommand.php index f3346816d64..f6c1a47d2f0 100644 --- a/Symfony/CS/Console/Command/FixCommand.php +++ b/Symfony/CS/Console/Command/FixCommand.php @@ -181,7 +181,14 @@ protected function execute(InputInterface $input, OutputInterface $output) $configFile = $input->getOption('config-file'); if (null === $configFile) { - $configDir = $path ?: getcwd(); + if (is_file($path) && $dirName = pathinfo($path, PATHINFO_DIRNAME)) { + $configDir = $dirName; + } elseif ($stdin) { + $configDir = getcwd(); + // path is directory + } else { + $configDir = $path; + } $configFile = $configDir . DIRECTORY_SEPARATOR . '.php_cs'; }