Documentation

Runner
in package

FinalYes
Tags
author

Dariusz Rumiński dariusz.ruminski@gmail.com

author

Greg Korba greg@codito.dev

phpstan-type

_RunResult array<string, array{appliedFixers: list, diff: string}>

Table of Contents

Constants

PARALLEL_BUFFER_SIZE  = 16 * (1024 * 1024)
Buffer size used in the NDJSON decoder for communication between main process and workers.

Properties

$cacheManager  : CacheManagerInterface
$configFile  : string|null
$differ  : DifferInterface
$directory  : DirectoryInterface|null
$errorsManager  : ErrorsManager
$eventDispatcher  : EventDispatcherInterface|null
$fileCount  : int
$fileIterator  : null|Traversable<string|int, SplFileInfo>
$fixers  : array<int, FixerInterface>
$input  : InputInterface|null
$isDryRun  : bool
$linter  : LinterInterface
$parallelConfig  : ParallelConfig
$stopOnViolation  : bool

Methods

__construct()  : mixed
fix()  : _RunResult
setFileIterator()  : void
dispatchEvent()  : void
fixFile()  : null|array{appliedFixers: list, diff: string}
fixParallel()  : _RunResult
Heavily inspired by {@see https://github.com/phpstan/phpstan-src/blob/9ce425bca5337039fb52c0acf96a20a2b8ace490/src/Parallel/ParallelAnalyser.php}.
fixSequential()  : _RunResult
getFilteringFileIterator()  : FileFilterIterator
getLintingFileIterator()  : LintingResultAwareFileIteratorInterface
processException()  : void
Process an exception that occurred.

Constants

Properties

$cacheManager

private CacheManagerInterface $cacheManager

$configFile

private string|null $configFile

$errorsManager

private ErrorsManager $errorsManager

$fileCount

private int $fileCount

$fileIterator

private null|Traversable<string|int, SplFileInfo> $fileIterator

$isDryRun

private bool $isDryRun

$stopOnViolation

private bool $stopOnViolation

Methods

__construct()

public __construct(null|Traversable<string|int, SplFileInfo$fileIterator, array<int, FixerInterface$fixers, DifferInterface $differ, EventDispatcherInterface|null $eventDispatcher, ErrorsManager $errorsManager, LinterInterface $linter, bool $isDryRun, CacheManagerInterface $cacheManager[, DirectoryInterface|null $directory = null ][, bool $stopOnViolation = false ][, ParallelConfig|null $parallelConfig = null ][, InputInterface|null $input = null ][, string|null $configFile = null ]) : mixed
Parameters
$fileIterator : null|Traversable<string|int, SplFileInfo>
$fixers : array<int, FixerInterface>
$differ : DifferInterface
$eventDispatcher : EventDispatcherInterface|null
$errorsManager : ErrorsManager
$linter : LinterInterface
$isDryRun : bool
$cacheManager : CacheManagerInterface
$directory : DirectoryInterface|null = null
$stopOnViolation : bool = false
$parallelConfig : ParallelConfig|null = null
$input : InputInterface|null = null
$configFile : string|null = null

fix()

public fix() : _RunResult
Return values
_RunResult

setFileIterator()

public setFileIterator(Traversable<string|int, SplFileInfo$fileIterator) : void
Parameters
$fileIterator : Traversable<string|int, SplFileInfo>
Tags
TODO

consider to drop this method and make iterator parameter obligatory in constructor, more in https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/7777/files#r1590447581

dispatchEvent()

private dispatchEvent(string $name, Event $event) : void
Parameters
$name : string
$event : Event

fixFile()

private fixFile(SplFileInfo $file, LintingResultInterface $lintingResult) : null|array{appliedFixers: list, diff: string}
Parameters
$file : SplFileInfo
$lintingResult : LintingResultInterface
Return values
null|array{appliedFixers: list, diff: string}

fixParallel()

Heavily inspired by {@see https://github.com/phpstan/phpstan-src/blob/9ce425bca5337039fb52c0acf96a20a2b8ace490/src/Parallel/ParallelAnalyser.php}.

private fixParallel() : _RunResult
Return values
_RunResult

fixSequential()

private fixSequential() : _RunResult
Return values
_RunResult

getFilteringFileIterator()

private getFilteringFileIterator() : FileFilterIterator
Return values
FileFilterIterator

getLintingFileIterator()

private getLintingFileIterator() : LintingResultAwareFileIteratorInterface
Return values
LintingResultAwareFileIteratorInterface

processException()

Process an exception that occurred.

private processException(string $name, Throwable $e) : void
Parameters
$name : string
$e : Throwable

        
On this page

Search results