Skip to content

ProcessBuilderInterface

github-actions edited this page Apr 17, 2026 · 1 revision

Defines a fluent builder responsible for constructing process instances.

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.


  • Full name: \FastForward\DevTools\Process\ProcessBuilderInterface

Methods

withArgument

Adds an argument to the process being built.

public withArgument(string $argument, ?string $value = null): self

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:

Parameter Type Description
$argument string the argument name or token that SHALL be added to the process definition
$value ?string an optional value associated with the argument

Return Value:

the current builder instance for fluent chaining


build

Builds a process instance for the specified command.

public build(string $command): \Symfony\Component\Process\Process

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:

Parameter Type Description
$command string the base command that SHALL be used to create the process

Return Value:

the configured process instance


Clone this wiki locally