PHPCBF support

This commit is contained in:
Ra100 2016-01-13 17:05:57 +01:00
parent 269d434a16
commit 2bc18dd601
3 changed files with 127 additions and 2 deletions

View File

@ -1691,6 +1691,54 @@ By default, all PSR-2 fixers and some additional ones are run. (Supported by PHP
} }
``` ```
#### [PHP - PHPCBF Path](#php---phpcbf-path)
**Namespace**: `php`
**Key**: `phpcbf_path`
**Type**: `string`
**Supported Beautifiers**: [`PHP-CS-Fixer`](#php-cs-fixer)
**Description**:
Path to the `phpcbf` CLI executable (Supported by PHP-CS-Fixer)
**Example `.jsbeautifyrc` Configuration**
```json
{
"php": {
"phpcbf_path": ""
}
}
```
#### [PHP - PHPCBF Standard](#php---phpcbf-standard)
**Namespace**: `php`
**Key**: `standard`
**Type**: `string`
**Supported Beautifiers**: [`PHP-CS-Fixer`](#php-cs-fixer) [`PHPCBF`](#phpcbf)
**Description**:
Standard name Squiz, PSR2, PSR1, PHPCS, PEAR, Zend, MySource... or path to CS rules (Supported by PHP-CS-Fixer, PHPCBF)
**Example `.jsbeautifyrc` Configuration**
```json
{
"php": {
"standard": ""
}
}
```
#### [Python - Max line length](#python---max-line-length) #### [Python - Max line length](#python---max-line-length)
**Namespace**: `python` **Namespace**: `python`
@ -3568,7 +3616,7 @@ Disable PHP Beautification
**Type**: `string` **Type**: `string`
**Enum**: `PHP-CS-Fixer` **Enum**: `PHP-CS-Fixer` `PHPCBF`
**Description**: **Description**:
@ -6500,6 +6548,81 @@ By default, all PSR-2 fixers and some additional ones are run. (Supported by PHP
} }
``` ```
#### [PHP - PHPCBF Path](#php---phpcbf-path)
**Namespace**: `php`
**Key**: `phpcbf_path`
**Type**: `string`
**Supported Beautifiers**: [`PHP-CS-Fixer`](#php-cs-fixer)
**Description**:
Path to the `phpcbf` CLI executable (Supported by PHP-CS-Fixer)
**Example `.jsbeautifyrc` Configuration**
```json
{
"php": {
"phpcbf_path": ""
}
}
```
#### [PHP - PHPCBF Standard](#php---phpcbf-standard)
**Namespace**: `php`
**Key**: `standard`
**Type**: `string`
**Supported Beautifiers**: [`PHP-CS-Fixer`](#php-cs-fixer) [`PHPCBF`](#phpcbf)
**Description**:
Standard name Squiz, PSR2, PSR1, PHPCS, PEAR, Zend, MySource... or path to CS rules (Supported by PHP-CS-Fixer, PHPCBF)
**Example `.jsbeautifyrc` Configuration**
```json
{
"php": {
"standard": ""
}
}
```
### PHPCBF
#### [PHP - PHPCBF Standard](#php---phpcbf-standard)
**Namespace**: `php`
**Key**: `standard`
**Type**: `string`
**Supported Beautifiers**: [`PHP-CS-Fixer`](#php-cs-fixer) [`PHPCBF`](#phpcbf)
**Description**:
Standard name Squiz, PSR2, PSR1, PHPCS, PEAR, Zend, MySource... or path to CS rules (Supported by PHP-CS-Fixer, PHPCBF)
**Example `.jsbeautifyrc` Configuration**
```json
{
"php": {
"standard": ""
}
}
```
### autopep8 ### autopep8

View File

@ -39,6 +39,7 @@ module.exports = class PHPCBF extends Beautifier
# Found phpcbf path # Found phpcbf path
@run("php", [ @run("php", [
phpcbfPath phpcbfPath
"--no-patch"
"--standard=#{options.standard}" if options.standard "--standard=#{options.standard}" if options.standard
tempFile = @tempFile("temp", text) tempFile = @tempFile("temp", text)
], { ], {
@ -64,6 +65,7 @@ module.exports = class PHPCBF extends Beautifier
) )
else else
@run("phpcbf", [ @run("phpcbf", [
"--no-patch"
"--standard=#{options.standard}" if options.standard "--standard=#{options.standard}" if options.standard
tempFile = @tempFile("temp", text) tempFile = @tempFile("temp", text)
], { ], {

View File

@ -42,6 +42,6 @@ module.exports = {
title: "PHPCBF Standard" title: "PHPCBF Standard"
type: 'string' type: 'string'
default: "", default: "",
description: "Standard name PEAR, PSR-1, PSR-2, Symphony... or path to CS rules" description: "Standard name Squiz, PSR2, PSR1, PHPCS, PEAR, Zend, MySource... or path to CS rules"
} }