Kraken\Supervision\Supervisor::resolveHandler PHP Method

resolveHandler() protected method

This method returns passed argument if it is instance of SolverInterface or newly created object of passed class if the $solverOrName argument was string. IllegalCallException is thrown if passed argument is string of invalid class.
protected resolveHandler ( Kraken\Supervision\SolverInterface | string $solverOrName ) : Kraken\Supervision\SolverInterface
$solverOrName Kraken\Supervision\SolverInterface | string
return Kraken\Supervision\SolverInterface
    protected function resolveHandler($solverOrName)
    {
        if (!is_string($solverOrName)) {
            return $solverOrName;
        }
        $ex = null;
        $handler = null;
        try {
            $handler = $this->factory->create($solverOrName);
        } catch (Error $ex) {
        } catch (Exception $ex) {
        }
        if ($ex !== null) {
            throw new IllegalCallException("Tried to invoke [{$solverOrName}] which is undefined.");
        }
        return $handler;
    }