Resolves common runtime-environment flags used by DevTools integrations.
Interfaces
Answers common runtime-environment questions from process environment flags.
Properties
Methods
Returns whether the current process exposes known AI-agent environment markers.
Returns whether the current process runs in a CI environment.
Returns whether the current process runs inside the Composer or PHPUnit test runtime.
Returns whether a truthy environment flag is enabled.
Returns whether the current process runs in GitHub Actions.
private
Detector
$agentDetector
private
EnvironmentInterface
$environment
public
__construct(EnvironmentInterface
$environment, Detector
$agentDetector) : mixed
Parameters
Description
reads raw process environment variables
$agentDetector
:
Detector
Description
detects known AI-agent environment markers
Returns whether the current process exposes known AI-agent environment markers.
public
isAgentPresent() : bool
Return values
Returns whether the current process runs in a CI environment.
public
isCi() : bool
Return values
Returns whether the current process runs inside the Composer or PHPUnit test runtime.
public
isComposerTestRun() : bool
Return values
Returns whether a truthy environment flag is enabled.
public
isEnabled(
string
$name) : bool
Parameters
$name
:
string
Description
the environment variable name
Return values
Description
true when the environment variable is enabled
Returns whether the current process runs in GitHub Actions.
public
isGithubActions() : bool