mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Add return types to tests (#10)
This commit is contained in:
parent
1321bfca36
commit
e9b60580f5
62 changed files with 153 additions and 155 deletions
|
@ -53,7 +53,7 @@ class ProcessExecutorMock extends ProcessExecutor
|
|||
{
|
||||
/** @var array{cmd: string|list<string>, return?: int, stdout?: string, stderr?: string, callback?: callable} $default */
|
||||
$default = array('cmd' => '', 'return' => 0, 'stdout' => '', 'stderr' => '', 'callback' => null);
|
||||
$this->expectations = array_map(function ($expect) use ($default) {
|
||||
$this->expectations = array_map(function ($expect) use ($default): array {
|
||||
if (is_string($expect)) {
|
||||
$command = $expect;
|
||||
$expect = $default;
|
||||
|
@ -89,7 +89,7 @@ class ProcessExecutorMock extends ProcessExecutor
|
|||
}
|
||||
|
||||
if (count($this->expectations) > 0) {
|
||||
$expectations = array_map(function ($expect) {
|
||||
$expectations = array_map(function ($expect): string {
|
||||
return is_array($expect['cmd']) ? implode(' ', $expect['cmd']) : $expect['cmd'];
|
||||
}, $this->expectations);
|
||||
throw new AssertionFailedError(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue