Config
in package
implements
ConfigInterface, ParallelAwareConfigInterface
Tags
Table of Contents
Interfaces
Properties
- $cacheFile : string
- $customFixers : array<int, FixerInterface>
- $finder : null|iterable<string|int, SplFileInfo>
- $format : string
- $hideProgress : bool
- $indent : string
- $isRiskyAllowed : bool
- $lineEnding : string
- $name : string
- $parallelConfig : ParallelConfig
- $phpExecutable : null|string
- $rules : array<string, array<string, mixed>|bool>
- $usingCache : bool
Methods
- __construct() : mixed
- getCacheFile() : null|string
- Returns the path to the cache file.
- getCustomFixers() : array<int, FixerInterface>
- Returns the custom fixers to use.
- getFinder() : Finder
- Returns files to scan.
- getFormat() : string
- getHideProgress() : bool
- Returns true if progress should be hidden.
- getIndent() : string
- getLineEnding() : string
- getName() : string
- Returns the name of the configuration.
- getParallelConfig() : ParallelConfig
- getPhpExecutable() : string|null
- Get configured PHP executable, if any.
- getRiskyAllowed() : bool
- Check if it is allowed to run risky fixers.
- getRules() : array<string, array<string, mixed>|bool>
- Get rules.
- getUsingCache() : bool
- Returns true if caching should be enabled.
- registerCustomFixers() : ConfigInterface
- Adds a suite of custom fixers.
- setCacheFile() : ConfigInterface
- Sets the path to the cache file.
- setFinder() : ConfigInterface
- setFormat() : ConfigInterface
- setHideProgress() : ConfigInterface
- setIndent() : ConfigInterface
- setLineEnding() : ConfigInterface
- setParallelConfig() : ConfigInterface
- setPhpExecutable() : ConfigInterface
- Set PHP executable.
- setRiskyAllowed() : ConfigInterface
- Set if it is allowed to run risky fixers.
- setRules() : ConfigInterface
- Set rules.
- setUsingCache() : ConfigInterface
- addCustomFixer() : void
Properties
$cacheFile
private
string
$cacheFile
= '.php-cs-fixer.cache'
$customFixers
private
array<int, FixerInterface>
$customFixers
= []
$finder
private
null|iterable<string|int, SplFileInfo>
$finder
= null
$format
private
string
$format
= 'txt'
$hideProgress
private
bool
$hideProgress
= false
$indent
private
string
$indent
= ' '
$isRiskyAllowed
private
bool
$isRiskyAllowed
= false
$lineEnding
private
string
$lineEnding
= "\n"
$name
private
string
$name
$parallelConfig
private
ParallelConfig
$parallelConfig
$phpExecutable
private
null|string
$phpExecutable
$rules
private
array<string, array<string, mixed>|bool>
$rules
Tags
$usingCache
private
bool
$usingCache
= true
Methods
__construct()
public
__construct([string $name = 'default' ]) : mixed
Parameters
- $name : string = 'default'
getCacheFile()
Returns the path to the cache file.
public
getCacheFile() : null|string
Return values
null|string —Returns null if not using cache
getCustomFixers()
Returns the custom fixers to use.
public
getCustomFixers() : array<int, FixerInterface>
Return values
array<int, FixerInterface>getFinder()
Returns files to scan.
public
getFinder() : Finder
Return values
FindergetFormat()
public
getFormat() : string
Return values
stringgetHideProgress()
Returns true if progress should be hidden.
public
getHideProgress() : bool
Return values
boolgetIndent()
public
getIndent() : string
Return values
stringgetLineEnding()
public
getLineEnding() : string
Return values
stringgetName()
Returns the name of the configuration.
public
getName() : string
The name must be all lowercase and without any spaces.
Return values
string —The name of the configuration
getParallelConfig()
public
getParallelConfig() : ParallelConfig
Return values
ParallelConfiggetPhpExecutable()
Get configured PHP executable, if any.
public
getPhpExecutable() : string|null
Return values
string|nullgetRiskyAllowed()
Check if it is allowed to run risky fixers.
public
getRiskyAllowed() : bool
Return values
boolgetRules()
Get rules.
public
getRules() : array<string, array<string, mixed>|bool>
Keys of array are names of fixers/sets, values are true/false.
Return values
array<string, array<string, mixed>|bool>getUsingCache()
Returns true if caching should be enabled.
public
getUsingCache() : bool
Return values
boolregisterCustomFixers()
Adds a suite of custom fixers.
public
registerCustomFixers(iterable<string|int, mixed> $fixers) : ConfigInterface
Name of custom fixer should follow VendorName/rule_name
convention.
Parameters
- $fixers : iterable<string|int, mixed>
Return values
ConfigInterfacesetCacheFile()
Sets the path to the cache file.
public
setCacheFile(string $cacheFile) : ConfigInterface
Parameters
- $cacheFile : string
Return values
ConfigInterfacesetFinder()
public
setFinder(iterable<string|int, mixed> $finder) : ConfigInterface
Parameters
- $finder : iterable<string|int, mixed>
Return values
ConfigInterfacesetFormat()
public
setFormat(string $format) : ConfigInterface
Parameters
- $format : string
Return values
ConfigInterfacesetHideProgress()
public
setHideProgress(bool $hideProgress) : ConfigInterface
Parameters
- $hideProgress : bool
Return values
ConfigInterfacesetIndent()
public
setIndent(string $indent) : ConfigInterface
Parameters
- $indent : string
Return values
ConfigInterfacesetLineEnding()
public
setLineEnding(string $lineEnding) : ConfigInterface
Parameters
- $lineEnding : string
Return values
ConfigInterfacesetParallelConfig()
public
setParallelConfig(ParallelConfig $config) : ConfigInterface
Parameters
- $config : ParallelConfig
Return values
ConfigInterfacesetPhpExecutable()
Set PHP executable.
public
setPhpExecutable(string|null $phpExecutable) : ConfigInterface
Parameters
- $phpExecutable : string|null
Return values
ConfigInterfacesetRiskyAllowed()
Set if it is allowed to run risky fixers.
public
setRiskyAllowed(bool $isRiskyAllowed) : ConfigInterface
Parameters
- $isRiskyAllowed : bool
Return values
ConfigInterfacesetRules()
Set rules.
public
setRules(array<string|int, mixed> $rules) : ConfigInterface
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).
Parameters
- $rules : array<string|int, mixed>
Return values
ConfigInterfacesetUsingCache()
public
setUsingCache(bool $usingCache) : ConfigInterface
Parameters
- $usingCache : bool
Return values
ConfigInterfaceaddCustomFixer()
private
addCustomFixer(FixerInterface $fixer) : void
Parameters
- $fixer : FixerInterface