Skip to content

Commit 00644ea

Browse files
authoredSep 1, 2016
Merge pull request #32 from romaricdrigon/feat-no-use-reorder
Added no-use-reorder option
2 parents 3eba234 + 5cf4626 commit 00644ea

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed
 

‎README.md

+6
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ The ``--dry-run`` option displays the files that need to be fixed but without ac
7676
$ symfony-upgrade-fixer fix /path/to/code --dry-run
7777
```
7878

79+
The ``--no-use-reorder`` option prevents the fixer from re-ordering USE statements:
80+
81+
```bash
82+
$ symfony-upgrade-fixer fix /path/to/code --no-use-reorder
83+
```
84+
7985
## Fixers available
8086

8187
| Name | Description |

‎README.tpl

+6
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ The ``--dry-run`` option displays the files that need to be fixed but without ac
7676
$ symfony-upgrade-fixer fix /path/to/code --dry-run
7777
```
7878

79+
The ``--no-use-reorder`` option prevents the fixer from re-ordering USE statements:
80+
81+
```bash
82+
$ symfony-upgrade-fixer fix /path/to/code --no-use-reorder
83+
```
84+
7985
## Fixers available
8086

8187
| Name | Description |

‎src/Symfony/Upgrade/Console/Command/FixCommand.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ protected function configure()
2323
[
2424
new InputArgument('path', InputArgument::REQUIRED),
2525
new InputOption('dry-run', '', InputOption::VALUE_NONE, 'Only shows which files would have been modified'),
26+
new InputOption('no-use-reorder', '', InputOption::VALUE_NONE, 'Dot not reorder USE statements alphabetically'),
2627
]
2728
)
2829
->setDescription('Fixes a directory or a file')
@@ -40,7 +41,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
4041
$stopwatch
4142
);
4243
$this->fixer->registerBuiltInFixers();
43-
$this->fixer->addFixer(new OrderedUseFixer());
44+
45+
if (! $input->getOption('no-use-reorder')) {
46+
$this->fixer->addFixer(new OrderedUseFixer());
47+
}
4448

4549
$stopwatch->start('fixFiles');
4650

0 commit comments

Comments
 (0)
Please sign in to comment.