PHP Interface PhpCsFixer\ConfigInterface

Author: Fabien Potencier ([email protected])
Exibir arquivo Open project: friendsofphp/php-cs-fixer Interface Usage Examples

Public Methods

Method Description
getCacheFile ( ) : string | null Returns the path to the cache file.
getCustomFixers ( ) : PhpCsFixer\Fixer\FixerInterface[] Returns the custom fixers to use.
getFinder ( ) : iterable | Traversable | string[] Returns files to scan.
getFormat ( ) : string
getHideProgress ( ) : boolean Returns true if progress should be hidden.
getIndent ( ) : string
getLineEnding ( ) : string
getName ( ) : string Returns the name of the configuration.
getPhpExecutable ( ) : string | null Get configured PHP executable, if any.
getRiskyAllowed ( ) : boolean Check if it is allowed to run risky fixers.
getRules ( ) : array Get rules.
getUsingCache ( ) : boolean Returns true if caching should be enabled.
registerCustomFixers ( iterable | Traversable | PhpCsFixer\Fixer\FixerInterface[] $fixers ) Adds a suite of custom fixers.
setCacheFile ( string $cacheFile ) : self Sets the path to the cache file.
setFinder ( iterable | Traversable | string[] $finder ) : self
setFormat ( string $format ) : self
setHideProgress ( boolean $hideProgress ) : self
setIndent ( string $indent ) : self
setLineEnding ( string $lineEnding ) : self
setPhpExecutable ( string | null $phpExecutable ) : self Set PHP executable.
setRiskyAllowed ( boolean $isRiskyAllowed ) : self Set if it is allowed to run risky fixers.
setRules ( array $rules ) : self Set rules.
setUsingCache ( boolean $usingCache ) : self

Method Details

getCacheFile() public method

Returns the path to the cache file.
public getCacheFile ( ) : string | null
return string | null Returns null if not using cache

getCustomFixers() public method

Returns the custom fixers to use.
public getCustomFixers ( ) : PhpCsFixer\Fixer\FixerInterface[]
return PhpCsFixer\Fixer\FixerInterface[]

getFinder() public method

Returns files to scan.
public getFinder ( ) : iterable | Traversable | string[]
return iterable | Traversable | string[]

getFormat() public method

public getFormat ( ) : string
return string

getHideProgress() public method

Returns true if progress should be hidden.
public getHideProgress ( ) : boolean
return boolean

getIndent() public method

public getIndent ( ) : string
return string

getLineEnding() public method

public getLineEnding ( ) : string
return string

getName() public method

The name must be all lowercase and without any spaces.
public getName ( ) : string
return string The name of the configuration

getPhpExecutable() public method

Get configured PHP executable, if any.
public getPhpExecutable ( ) : string | null
return string | null

getRiskyAllowed() public method

Check if it is allowed to run risky fixers.
public getRiskyAllowed ( ) : boolean
return boolean

getRules() public method

Keys of array are names of fixers/sets, values are true/false.
public getRules ( ) : array
return array

getUsingCache() public method

Returns true if caching should be enabled.
public getUsingCache ( ) : boolean
return boolean

registerCustomFixers() public method

Name of custom fixer should follow VendorName/rule_name convention.
public registerCustomFixers ( iterable | Traversable | PhpCsFixer\Fixer\FixerInterface[] $fixers )
$fixers iterable | Traversable | PhpCsFixer\Fixer\FixerInterface[]

setCacheFile() public method

Sets the path to the cache file.
public setCacheFile ( string $cacheFile ) : self
$cacheFile string
return self

setFinder() public method

public setFinder ( iterable | Traversable | string[] $finder ) : self
$finder iterable | Traversable | string[]
return self

setFormat() public method

public setFormat ( string $format ) : self
$format string
return self

setHideProgress() public method

public setHideProgress ( boolean $hideProgress ) : self
$hideProgress boolean
return self

setIndent() public method

public setIndent ( string $indent ) : self
$indent string
return self

setLineEnding() public method

public setLineEnding ( string $lineEnding ) : self
$lineEnding string
return self

setPhpExecutable() public method

Set PHP executable.
public setPhpExecutable ( string | null $phpExecutable ) : self
$phpExecutable string | null
return self

setRiskyAllowed() public method

Set if it is allowed to run risky fixers.
public setRiskyAllowed ( boolean $isRiskyAllowed ) : self
$isRiskyAllowed boolean
return self

setRules() public method

Keys of array are names of fixers or sets. Value for set must be bool (turn it on or off). Value for fixer may be bool (turn it on or off) or array of configuration (turn it on and contains configuration for FixerInterface::configure method).
public setRules ( array $rules ) : self
$rules array
return self

setUsingCache() public method

public setUsingCache ( boolean $usingCache ) : self
$usingCache boolean
return self