Documentation

Config
in package
implements ConfigInterface, ParallelAwareConfigInterface

Tags
author

Fabien Potencier fabien@symfony.com

author

Katsuhiro Ogawa ko.fivestar@gmail.com

author

Dariusz Rumiński dariusz.ruminski@gmail.com

Table of Contents

Interfaces

ConfigInterface
ParallelAwareConfigInterface

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'

$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"

$phpExecutable

private null|string $phpExecutable

$rules

private array<string, array<string, mixed>|bool> $rules
Tags
TODO:

4.0 - update to @PER

$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

getFormat()

public getFormat() : string
Return values
string

getHideProgress()

Returns true if progress should be hidden.

public getHideProgress() : bool
Return values
bool

getIndent()

public getIndent() : string
Return values
string

getLineEnding()

public getLineEnding() : string
Return values
string

getName()

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

getPhpExecutable()

Get configured PHP executable, if any.

public getPhpExecutable() : string|null
Return values
string|null

getRiskyAllowed()

Check if it is allowed to run risky fixers.

public getRiskyAllowed() : bool
Return values
bool

getRules()

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
bool

registerCustomFixers()

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
ConfigInterface

setRiskyAllowed()

Set if it is allowed to run risky fixers.

public setRiskyAllowed(bool $isRiskyAllowed) : ConfigInterface
Parameters
$isRiskyAllowed : bool
Return values
ConfigInterface

setRules()

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
ConfigInterface

        
On this page

Search results