Sign inSign up

eccube/upgrade-fixer

By eccube

Updated about 9 years ago

EC-CUBE Upgrade Fixer

Image
1

1.0K

eccube/upgrade-fixer repository overview

EC-CUBE Upgrade Fixer Build Status

EC-CUBE3.0系のプラグインプロジェクトを解析して、EC-CUBE3.1系に互換性のあるコードに変換します。このツールは Symfony Upgrade Fixer をフォークしています。

インストール

手動
ローカルインストール

eccube-upgrade-fixer.pharをダウンロードしてローカルに保存します。

グローバルインストール

以下のコマンドで簡単にeccube-upgrade-fixerコマンドをインストールできます。

$ sudo wget https://github.com/EC-CUBE/Eccube-Upgrade-Fixer/releases/download/v0.1.5-eccube-3.1.0-alpha/eccube-upgrade-fixer.phar -O /usr/local/bin/eccube-upgrade-fixer
$ sudo chmod a+x /usr/local/bin/eccube-upgrade-fixer

インストールしたら、eccube-upgrade-fixerコマンドが使用できます。

Composer

Composerでのインストール方法は今のところありません。

使い方

fixコマンドを使用して指定したパスのコードを変換します。

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

--dry-runオプションを付けると、ファイルは変更せずに変換が必要なファイルを表示します。

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

--no-use-reorderオプションを指定した場合は、use文の並び替えを行いません。

$ eccube-upgrade-fixer fix /path/to/code --no-use-reorder
Dockerで利用する

プラグインプロジェクトのディレクトリをマウントすれば以下のようにDockerで実行することができます。

docker run --rm -v /path/to/plugin:/app eccube/upgrade-fixer fix /app

利用可能なFixer一覧

NameDescription
app_requestFix $app["request"] -> $app["request"]->getCurrentRequest().
eccube_form_type_namesEC-CUBE FormType support.
form_choice_type_arrayFlip choices in ChoiceType.
form_configure_optionsThe method AbstractType::setDefaultOptions(OptionsResolverInterface $resolver) have been renamed to AbstractType::configureOptions(OptionsResolver $resolver).
form_eventsThe events PRE_BIND, BIND and POST_BIND were renamed to PRE_SUBMIT, SUBMIT and POST_SUBMIT.
form_getname_to_getblockprefixThe method FormTypeInterface::getName() was deprecated, you should now implement FormTypeInterface::getBlockPrefix() instead.
form_option_namesOptions precision and virtual was renamed to scale and inherit_data.
form_parent_typeReturning type instances from FormTypeInterface::getParent() is deprecated, return the fully-qualified class name of the parent type class instead.
form_type_namesInstead of referencing types by name, you should reference them by their fully-qualified class name (FQCN) instead.
get_requestThe getRequest method of the base controller class was removed, request object is injected in the action method instead.
inherit_data_aware_iteratorThe class VirtualFormAwareIterator was renamed to InheritDataAwareIterator.
progress_barProgressHelper has been removed in favor of ProgressBar.
property_accessRenamed PropertyAccess::getPropertyAccessor to PropertyAccess::createPropertyAccessor.
service_providerFix ServiceProvider.

Contribute

このツールはSymfony Upgrade Fixerをフォークしています。 EC-CUBE3.1系に特化したものでないなら、Symfony Upgrade Fixer にコントリビュートしてください。

このREADMEにコントリビュートする場合は、直接README.mdを変更するのではなく、README.tplを変更してから以下のコマンドを実行してください:

$ eccube-upgrade-fixer readme > README.md

Tag summary

Content type

Image

Digest

Size

151.3 MB

Last updated

about 9 years ago

docker pull eccube/upgrade-fixer