class Commander

Traits

Constants

protected TESTBENCH

The testbench implementation class.

Properties

protected Application|null $app

Application instance.

protected Config $config

List of configurations.

protected string $environmentFile

The environment file name.

protected array<int, class-string> $providers

List of providers.

protected array<int, int> $registeredSignals

Registered pcntl signal handlers for cleanup on teardown.

protected bool|null $previousAsyncSignals

Whether async signals were enabled before we changed them.

Methods

void
copyTestbenchConfigurationFile(Application $app, Filesystem $filesystem, string $workingPath, bool $backupExistingFile = true, bool $resetOnTerminating = true)

Copy the "testbench.yaml" file.

void
copyTestbenchDotEnvFile(Application $app, Filesystem $filesystem, string $workingPath, bool $backupExistingFile = true, bool $resetOnTerminating = true)

Copy the ".env" file.

string
testbenchEnvironmentFile()

Determine the Testbench's environment file.

__construct(Config|array $config, string $workingPath)

Construct a new Commander.

void
handle()

Handle the command.

hypervel()

Create a Hypervel application.

resolveApplicationCallback()

Resolve application implementation callback.

array
extraAttributes()

Get extra attributes for the Testbench application.

string
getApplicationBasePath()

Resolve the application's base path.

static string
applicationBasePath()

Get the application's base path.

int
handleException(OutputInterface $output, Throwable $error)

Render an exception to the console.

void
prepareCommandEnvironment(InputInterface $input)

Prepare environment variables required by the incoming command.

void
prepareCommandSignals()

Prepare process-level signal handlers for clean shutdown.

void
unregisterSignals()

Restore default signal handlers.

Details

in CopyTestbenchFiles at line 23
protected void copyTestbenchConfigurationFile(Application $app, Filesystem $filesystem, string $workingPath, bool $backupExistingFile = true, bool $resetOnTerminating = true)

internal  
 

Copy the "testbench.yaml" file.

Parameters

Application $app
Filesystem $filesystem
string $workingPath
bool $backupExistingFile
bool $resetOnTerminating

Return Value

void

in CopyTestbenchFiles at line 68
protected void copyTestbenchDotEnvFile(Application $app, Filesystem $filesystem, string $workingPath, bool $backupExistingFile = true, bool $resetOnTerminating = true)

internal  
 

Copy the ".env" file.

Parameters

Application $app
Filesystem $filesystem
string $workingPath
bool $backupExistingFile
bool $resetOnTerminating

Return Value

void

in CopyTestbenchFiles at line 105
protected string testbenchEnvironmentFile()

internal  
 

Determine the Testbench's environment file.

Return Value

string

at line 83
__construct(Config|array $config, string $workingPath)

Construct a new Commander.

Parameters

Config|array $config
string $workingPath

at line 95
void handle()

Handle the command.

Return Value

void

at line 126
Application hypervel()

Create a Hypervel application.

Return Value

Application

at line 174
protected Closure resolveApplicationCallback()

Resolve application implementation callback.

Return Value

Closure

at line 192
protected array extraAttributes()

Get extra attributes for the Testbench application.

Return Value

array

at line 207
protected string getApplicationBasePath()

Resolve the application's base path.

Return Value

string

at line 224
static string applicationBasePath()

Get the application's base path.

Return Value

string

at line 232
protected int handleException(OutputInterface $output, Throwable $error)

Render an exception to the console.

Parameters

OutputInterface $output
Throwable $error

Return Value

int

at line 253
protected void prepareCommandEnvironment(InputInterface $input)

Prepare environment variables required by the incoming command.

Parameters

InputInterface $input

Return Value

void

at line 269
protected void prepareCommandSignals()

Prepare process-level signal handlers for clean shutdown.

Uses pcntl directly since Commander runs outside the Swoole event loop.

Return Value

void

at line 307
protected void unregisterSignals()

Restore default signal handlers.

Return Value

void