private function exceptionToExitCode($code) { if (!is_numeric($code)) { return 1; } return min(max((int) $code, 1), 255); }