umpirsky/symfony-upgrade-fixer

Analyzes your Symfony project and tries to make it compatible with the new version of Symfony framework.

Installs: 487 454

Dependents: 0

Suggesters: 0

Security: 0

Stars: 275

Watchers: 10

Forks: 18

Open Issues: 13

Type:application

v0.1.6 2017-03-03 07:49 UTC

README

symfony upgrade fixertwig gettext extractorwisdomcentipedepermissions handlerextraloadgravatarlocurrocountry listtransliterator

Symfony Upgrade Fixer Build Status

Analyzes your Symfony project and tries to make it compatible with the new version of Symfony framework.

Installation

Manual

Local

Download the symfony-upgrade-fixer.phar file and store it somewhere on your computer.

Global

You can run these commands to easily access symfony-upgrade-fixer from anywhere on your system:

$ sudo wget https://github.com/umpirsky/Symfony-Upgrade-Fixer/releases/download/v0.1.6/symfony-upgrade-fixer.phar -O /usr/local/bin/symfony-upgrade-fixer
$ sudo chmod a+x /usr/local/bin/symfony-upgrade-fixer

Then, just run symfony-upgrade-fixer.

Composer

Local

$ composer require umpirsky/symfony-upgrade-fixer

Global

$ composer global require umpirsky/symfony-upgrade-fixer

Make sure you have ~/.composer/vendor/bin in your PATH and you're good to go:

$ export PATH="$PATH:$HOME/.composer/vendor/bin"

Don't forget to add this line in your .bashrc file if you want to keep this change after reboot.

Usage

The fix command tries to fix as much upgrade issues as possible on a given file or directory:

$ symfony-upgrade-fixer fix /path/to/dir
$ symfony-upgrade-fixer fix /path/to/file

The --dry-run option displays the files that need to be fixed but without actually modifying them:

$ symfony-upgrade-fixer fix /path/to/code --dry-run

The --no-use-reorder option prevents the fixer from re-ordering USE statements:

$ symfony-upgrade-fixer fix /path/to/code --no-use-reorder

The --fixers option allows to specify which fixers should be used:

$ symfony-upgrade-fixer fix /path/to/code --fixers=get_request,form_events,property_access

Fixers available

Real Life Examples

It is tested against few cool Symfony projects:

Contribute

The tool is based on PHP Coding Standards Fixer and the contributing process is very similar. I see no sense in re-doing it so far.

If you want to contribute to README, please don't edit README.md directly - it is autogenerated. Edit README.tpl instead and run:

$ symfony-upgrade-fixer readme > README.md