崇高なテキスト3フォーマットコードスタイルプラグpsr2



Sublime Text 3 Format Code Style Plug Psr2



一般的に使用されるフォーマットプラグインにはCodeFomatterとphpfmtがあり、CodeFormatterは個人的に少し好みます。

##インストール:
1、Ctrl + Shift + P、CodeFormatter入力、次にトランスポートをインストールします。



##構成:
1、[設定]-> [ブラウザパッケージ]で、親ディレクトリ、つまりデータディレクトリ、CodeFormatterの新しいフォルダに戻り、php、ローカルインストールディレクトリphp、php.exeファイルのコピーとphp7ts.dllが含まれるフォルダを作成します。ディレクトリ構造はSublimeText 3 Data CodeFormatter php です。

2、[設定]-> [パッケージ設定]-> [CodeFormatter]-> [設定]を開きます-ユーザーの追加は、php_pathに追加されたData CodeFormatter php php.exeを構成します。



{ 'codeformatter_debug': false, 'codeformatter_php_options': vendor).)*$' 'php55_compat': false, // PHP 5.5 compatible mode 'psr1': false, // Activate PSR1 style 'psr1_naming': false, // Activate PSR1 style - Section 3 and 4.3 - Class and method names case 'psr2': true, // Activate PSR2 style 'indent_with_space': 4, // Use spaces instead of tabs for indentation 'enable_auto_align': true, // Enable auto align of = and => 'visibility_order': true, // Fixes visibility order for method in classes - PSR-2 4.2 'smart_linebreak_after_curly': true, // Convert multistatement blocks into multiline blocks // Enable specific transformations. Example: ['ConvertOpenTagWithEcho', 'PrettyPrintDocBlocks'] // You can list all available transformations from command palette: CodeFormatter: Show PHP Transformations 'passes': [], // Disable specific transformations 'excludes': [] }

3、Ctrl + Alt + fフォーマットコードに使用されるフォーマットされたファイルが必要です。

注:バージョン7.2以下の最適な選択を構成するためのphpバージョンの最初のステップ、またはCodeFormatterは文句を言います。参照: https://blog.csdn.net/leedaning/article/details/100104452

この記事の内容は次のとおりです。 https://blog.csdn.net/leedaning/article/details/100105175
著者:leedaning