Merge pull request #1511 from onigra/correspondence-to-php-cs-fixer-v2
Correspondence to PHP-CS-Fixer v2
This commit is contained in:
commit
3ea44935e5
|
@ -9447,8 +9447,7 @@ Specify a configuration file which will override the default name of .perltidyrc
|
|||
| `default_beautifier` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
||||
| `beautify_on_save` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
||||
| `cs_fixer_path` | :white_check_mark: | :x: | :x: |
|
||||
| `fixers` | :white_check_mark: | :x: | :x: |
|
||||
| `level` | :white_check_mark: | :x: | :x: |
|
||||
| `rules` | :white_check_mark: | :x: | :x: |
|
||||
| `phpcbf_path` | :white_check_mark: | :x: | :x: |
|
||||
| `standard` | :white_check_mark: | :white_check_mark: | :x: |
|
||||
|
||||
|
@ -9523,7 +9522,7 @@ Automatically beautify PHP files on save
|
|||
|
||||
**Description**:
|
||||
|
||||
Path to the `php-cs-fixer` CLI executable (Supported by PHP-CS-Fixer)
|
||||
Absolute path to the `php-cs-fixer` CLI executable (Supported by PHP-CS-Fixer)
|
||||
|
||||
**Example `.jsbeautifyrc` Configuration**
|
||||
|
||||
|
@ -9535,50 +9534,26 @@ Path to the `php-cs-fixer` CLI executable (Supported by PHP-CS-Fixer)
|
|||
}
|
||||
```
|
||||
|
||||
##### [Fixers](#fixers)
|
||||
##### [Rules](#rules)
|
||||
|
||||
**Namespace**: `php`
|
||||
|
||||
**Key**: `fixers`
|
||||
**Key**: `rules`
|
||||
|
||||
**Type**: `string`
|
||||
|
||||
**Supported Beautifiers**: [`PHP-CS-Fixer`](#php-cs-fixer)
|
||||
**Supported Beautifiers**: [`PHP-CS-Fixer`](#php-cs-fixer)
|
||||
|
||||
**Description**:
|
||||
|
||||
Add fixer(s). i.e. linefeed,-short_tag,indentation (Supported by PHP-CS-Fixer)
|
||||
Add rule(s). i.e. line_ending,-full_opening_tag,@PSR2 (Supported by PHP-CS-Fixer)
|
||||
|
||||
**Example `.jsbeautifyrc` Configuration**
|
||||
|
||||
```json
|
||||
{
|
||||
"php": {
|
||||
"fixers": ""
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
##### [Level](#level)
|
||||
|
||||
**Namespace**: `php`
|
||||
|
||||
**Key**: `level`
|
||||
|
||||
**Type**: `string`
|
||||
|
||||
**Supported Beautifiers**: [`PHP-CS-Fixer`](#php-cs-fixer)
|
||||
|
||||
**Description**:
|
||||
|
||||
By default, all PSR-2 fixers and some additional ones are run. (Supported by PHP-CS-Fixer)
|
||||
|
||||
**Example `.jsbeautifyrc` Configuration**
|
||||
|
||||
```json
|
||||
{
|
||||
"php": {
|
||||
"level": ""
|
||||
"rules": ""
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
|
@ -21,9 +21,9 @@ module.exports = class PHPCSFixer extends Beautifier
|
|||
configFile = if context? and context.filePath? then @findFile(path.dirname(context.filePath), '.php_cs')
|
||||
phpCsFixerOptions = [
|
||||
"fix"
|
||||
"--level=#{options.level}" if options.level
|
||||
"--fixers=#{options.fixers}" if options.fixers
|
||||
"--config-file=#{configFile}" if configFile
|
||||
"--rules=#{options.rules}" if options.rules
|
||||
"--config=#{configFile}" if configFile
|
||||
"--using-cache=no"
|
||||
]
|
||||
runOptions = {
|
||||
ignoreReturnCode: true
|
||||
|
|
|
@ -26,15 +26,11 @@ module.exports = {
|
|||
title: "PHP-CS-Fixer Path"
|
||||
type: 'string'
|
||||
default: ""
|
||||
description: "Path to the `php-cs-fixer` CLI executable"
|
||||
fixers:
|
||||
description: "Absolute path to the `php-cs-fixer` CLI executable"
|
||||
rules:
|
||||
type: 'string'
|
||||
default: ""
|
||||
description: "Add fixer(s). i.e. linefeed,-short_tag,indentation"
|
||||
level:
|
||||
type: 'string'
|
||||
default: ""
|
||||
description: "By default, all PSR-2 fixers and some additional ones are run."
|
||||
description: "Add rule(s). i.e. line_ending,-full_opening_tag,@PSR2"
|
||||
phpcbf_path:
|
||||
title: "PHPCBF Path"
|
||||
type: 'string'
|
||||
|
|
Loading…
Reference in New Issue