XdebugDisablingProcessEnvironmentConfigurator

Class
Read only: Yes Final: Yes

Disables Xdebug for child processes unless coverage still needs it.

Table of Contents

Interfaces

ProcessEnvironmentConfiguratorInterface

Configures subprocess environment variables before queued execution.

Constants

 = ['--coverage', '--coverage-clover', '--coverage-cobertura', '--coverage-crap4j', '--coverage-html', '--coverage-php', '--coverage-text', '--coverage-xml', '--min-coverage']

Properties

Methods

 : mixed
configure()

Configures Xdebug-related environment variables for nested commands.

 : void
containsCommandLineArgument()

Determines whether a command line contains an exact long option.

 : bool
isTruthyEnvironmentFlag()

Determines whether an environment flag is set to a truthy value.

 : bool
requiresCoverage()

Determines whether the child process command line requests coverage.

 : bool
shouldDisableXdebug()

Determines whether Xdebug can be disabled for the child process.

 : bool
Constants

Constants

COVERAGE_ARGUMENT_PATTERNS

Private
private array<int, string> COVERAGE_ARGUMENT_PATTERNS = ['--coverage', '--coverage-clover', '--coverage-cobertura', '--coverage-crap4j', '--coverage-html', '--coverage-php', '--coverage-text', '--coverage-xml', '--min-coverage']
Properties
Methods

configure()

Public

Configures Xdebug-related environment variables for nested commands.

public configure(Process  $process, OutputInterface  $output) : void
Parameters
$process : Process

Description

the queued process that will be started

$output : OutputInterface

Description

the parent output used to infer console capabilities

containsCommandLineArgument()

Private

Determines whether a command line contains an exact long option.

private containsCommandLineArgument( string  $commandLine, string  $argument) : bool
Parameters
$commandLine : string

Description

the shell-escaped command line

$argument : string

Description

the long option to find

Return values
bool

Description

true when the exact option is present

isTruthyEnvironmentFlag()

Private

Determines whether an environment flag is set to a truthy value.

private isTruthyEnvironmentFlag( string  $name) : bool
Parameters
$name : string

Description

the environment variable name

Return values
bool

Description

true when the environment variable is truthy

requiresCoverage()

Private

Determines whether the child process command line requests coverage.

private requiresCoverage(Process  $process) : bool
Parameters
$process : Process

Description

the queued process that will be started

Return values
bool

Description

true when coverage arguments are present

shouldDisableXdebug()

Private

Determines whether Xdebug can be disabled for the child process.

private shouldDisableXdebug(Process  $process) : bool
Parameters
$process : Process

Description

the queued process that will be started

Return values
bool

Description

true when Xdebug should be disabled for the child process