Runner
in package
FinalYes
Tags
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
PARALLEL_BUFFER_SIZE
Buffer size used in the NDJSON decoder for communication between main process and workers.
private
mixed
PARALLEL_BUFFER_SIZE
= 16 * (1024 * 1024)
Tags
Properties
$cacheManager
private
CacheManagerInterface
$cacheManager
$configFile
private
string|null
$configFile
$differ
private
DifferInterface
$differ
$directory
private
DirectoryInterface|null
$directory
$errorsManager
private
ErrorsManager
$errorsManager
$eventDispatcher
private
EventDispatcherInterface|null
$eventDispatcher
$fileCount
private
int
$fileCount
$fileIterator
private
null|Traversable<string|int, SplFileInfo>
$fileIterator
$fixers
private
array<int, FixerInterface>
$fixers
$input
private
InputInterface|null
$input
$isDryRun
private
bool
$isDryRun
$linter
private
LinterInterface
$linter
$parallelConfig
private
ParallelConfig
$parallelConfig
$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
_RunResultsetFileIterator()
public
setFileIterator(Traversable<string|int, SplFileInfo> $fileIterator) : void
Parameters
- $fileIterator : Traversable<string|int, SplFileInfo>
Tags
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: listfixParallel()
Heavily inspired by {@see https://github.com/phpstan/phpstan-src/blob/9ce425bca5337039fb52c0acf96a20a2b8ace490/src/Parallel/ParallelAnalyser.php}.
private
fixParallel() : _RunResult
Return values
_RunResultfixSequential()
private
fixSequential() : _RunResult
Return values
_RunResultgetFilteringFileIterator()
private
getFilteringFileIterator() : FileFilterIterator
Return values
FileFilterIteratorgetLintingFileIterator()
private
getLintingFileIterator() : LintingResultAwareFileIteratorInterface
Return values
LintingResultAwareFileIteratorInterfaceprocessException()
Process an exception that occurred.
private
processException(string $name, Throwable $e) : void
Parameters
- $name : string
- $e : Throwable