getExitCode(); } $hooks = [ HookManager::STATUS_DETERMINER, ]; // If the result does not implement ExitCodeInterface, // then we'll see if there is a determiner that can // extract a status code from the result. $determiners = $this->getHooks($hooks); foreach ($determiners as $determiner) { $status = $this->callDeterminer($determiner, $result); if (isset($status)) { return $status; } } } protected function callDeterminer($determiner, $result) { if ($determiner instanceof StatusDeterminerInterface) { return $determiner->determineStatusCode($result); } if (is_callable($determiner)) { return $determiner($result); } } }