• Stars
    star
    273
  • Rank 150,780 (Top 3 %)
  • Language
    PHP
  • License
    MIT License
  • Created about 9 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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

Name Description
form_configure_options The method AbstractType::setDefaultOptions(OptionsResolverInterface $resolver) have been renamed to AbstractType::configureOptions(OptionsResolver $resolver).
form_events The events PRE_BIND, BIND and POST_BIND were renamed to PRE_SUBMIT, SUBMIT and POST_SUBMIT.
form_getname_to_getblockprefix The method FormTypeInterface::getName() was deprecated, you should now implement FormTypeInterface::getBlockPrefix() instead.
form_option_names Options precision and virtual was renamed to scale and inherit_data.
form_parent_type Returning type instances from FormTypeInterface::getParent() is deprecated, return the fully-qualified class name of the parent type class instead.
form_type_names Instead of referencing types by name, you should reference them by their fully-qualified class name (FQCN) instead.
form_extension_get_extended_type Instead of referencing extended types by name, you should reference them by their fully-qualified class name (FQCN) instead.
get_request The getRequest method of the base controller class was removed, request object is injected in the action method instead.
inherit_data_aware_iterator The class VirtualFormAwareIterator was renamed to InheritDataAwareIterator.
progress_bar ProgressHelper has been removed in favor of ProgressBar.
property_access Renamed PropertyAccess::getPropertyAccessor to PropertyAccess::createPropertyAccessor.

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

More Repositories

1

country-list

🌐 List of all countries with names and ISO 3166-1 codes in all languages and data formats.
HTML
5,060
star
2

language-list

List of all languages with names and ISO 639-1 codes in all languages and all data formats.
HTML
509
star
3

currency-list

💰 List of all currencies with names and ISO 4217 codes in all languages and all data formats.
HTML
303
star
4

locale-list

List of all locales with names and codes in all languages and all data formats.
HTML
302
star
5

tld-list

List of all top-level domains in all data formats.
HTML
163
star
6

centipede

🎇 The Simplest automated testing tool on Earth.
PHP
141
star
7

wisdom

Domain availability checker.
PHP
121
star
8

Twig-Gettext-Extractor

The Twig Gettext Extractor is Poedit friendly tool which extracts translations from twig templates.
PHP
114
star
9

PermissionsHandler

🔒 Composer script handling directories permissions by making them writable both by the web server and the command line user.
PHP
66
star
10

Transliterator

Transliterator is a PHP library for text transliteration.
PHP
60
star
11

twig-php-function

Call (almost) any PHP function from your Twig templates.
PHP
60
star
12

centipede-crawler

Crawls all unique links.
PHP
42
star
13

umpirsky.com

Source code for umpirsky.com
CSS
40
star
14

Extraload

Powerful ETL library.
PHP
34
star
15

locurro

💶 Local currency converter.
PHP
33
star
16

list-generator

Export data to various formats.
PHP
20
star
17

Gravatar

Lightweight Gravatar library.
PHP
16
star
18

silex-on-steroids

Silex demo application.
PHP
13
star
19

Freelander

Simple landing page that just works.
CSS
9
star
20

zymfony-validator

Zend validator adapter for Symfony
PHP
8
star
21

symfony-cli-calculator

Simple demo CLI calculator based on Symfony Console Component
PHP
8
star
22

I18nRoutingServiceProvider

Silex i18n routing service provider.
PHP
7
star
23

eclipse-templates

Eclipse code templates
6
star
24

Oregon

Statistics library for open source organizations.
PHP
5
star
25

chess-notifier

Get Chess.com browser notifications on your desktop. Never lose on time again!
JavaScript
5
star
26

Sylex

Sylex is a tiny layer on top of Silex framework.
PHP
5
star
27

country-list.umpirsky.com

Country list website
JavaScript
4
star
28

Simplex

The PHP micro-framework based on Silex
PHP
4
star
29

UmpirskyI18nRoutingBundle

Internationalized routing with minimal performance cost.
PHP
3
star
30

Titlerator

Convert subtitles to utf-8 encoding.
PHP
2
star
31

rhytmbox-tunein-import

Script to import your radio stations from TuneIn into Rhythmbox.
Python
2
star
32

EPS

Malo punimo EPS
PHP
1
star
33

hello-github

Just playing with git
1
star
34

top-github-repositories

Orders GitHub repositories by given parameter.
PHP
1
star
35

nautilus-scripts

Nautilus scripts
Python
1
star
36

stajesti.rs

Projekat koji daje odgovor na večito pitanje.
CSS
1
star
37

top-php-frameworks

Top ranking PHP frameworks.
PHP
1
star
38

Simplex-Demo

Simple website made in Simplex
JavaScript
1
star
39

phpsummercamp-phpspec

PHPSpec uses specifications to describe object behaviour as an input language rather than user stories. We always focus on a single object while mocking other dependencies. This is incredibly easy with the Prophecy mocking framework, which is created to fulfill PHPSpec needs. In this workshop we will introduce you to the basics of PHPSpec and show you how to describe your objects the right way.
1
star