Permalink
Browse files

added support for relative paths

  • Loading branch information...
1 parent bca076a commit 71ec8406ac91619b20150adbeb48bfe11e3f4ea8 @fabpot committed May 16, 2012
Showing with 29 additions and 9 deletions.
  1. +8 −1 Symfony/CS/Console/Command/FixCommand.php
  2. +1 −0 composer.json
  3. +20 −8 composer.lock
  4. BIN symfony-cs-fixer.phar
@@ -16,6 +16,7 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Filesystem\Filesystem;
use Symfony\CS\Fixer;
/**
@@ -55,8 +56,14 @@ protected function execute(InputInterface $input, OutputInterface $output)
$fixer = new Fixer();
$fixer->registerBuiltInFixers();
+ $dir = $input->getArgument('dir');
+ $filesystem = new Filesystem();
+ if (!$filesystem->isAbsolutePath($dir)) {
+ $dir = getcwd().DIRECTORY_SEPARATOR.$dir;
+ }
+
$class = 'Symfony\\CS\\Finder\\'.$input->getArgument('finder');
- $iterator = new $class($input->getArgument('dir'));
+ $iterator = new $class($dir);
$changed = $fixer->fix($iterator);
View
@@ -12,6 +12,7 @@
"require": {
"php": ">=5.3.0",
"symfony/console": "2.1.*",
+ "symfony/filesystem": "2.1.*",
"symfony/finder": "2.1.*"
},
"autoload": {
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
Binary file not shown.

0 comments on commit 71ec840

Please sign in to comment.