ProcessBuilderInterface
Defines a fluent builder responsible for constructing process instances.
Description
Implementations MUST preserve the builder state consistently across chained calls and SHALL return a process configured according to all previously supplied arguments when build() is invoked.
Methods
Builds a process instance for the specified command.
Adds an argument to the process being built.
Builds a process instance for the specified command.
public
build(
string|array<string|int, mixed>
$command) : Process
Description
Implementations MUST return a Process configured with the provided command and all arguments previously collected by the builder. The returned process SHOULD be ready for execution by the caller.
Parameters
$command
:
string|array<string|int, mixed>
Description
the base command that SHALL be used to create the process
Return values
Description
the configured process instance
Adds an argument to the process being built.
public
withArgument(
string
$argument[,
string|null
$value = null]) : self
Description
Implementations MUST append or register the provided argument for later use when build() is called. When a non-empty value is provided, the implementation SHALL associate that value with the argument according to its command-building strategy.
Parameters
$argument
:
string
Description
the argument name or token that SHALL be added to the process definition
$value
:
string|null
=
null
Description
an optional value associated with the argument
Return values
Description
the current builder instance for fluent chaining