public function countStatus($status)
{
if ($status === 'pending') {
return $this->countPending();
} elseif ($status === 'running') {
return $this->countRunning();
} elseif ($status === 'succeeded') {
return $this->countSucceeded();
} elseif ($status === 'failed') {
return $this->countFailed();
}
throw new \InvalidArgumentException(sprintf('Status "%s" seems not to be a good status.', $status));
}