Cascade\Tests\Config\Loader\ClassLoader\HandlerLoaderTest::getHandler PHP Method

getHandler() private method

Check if the handler exists for a given class and option Also checks that it a callable and return it
private getHandler ( string $class, string $optionName ) : Closure
$class string Class name the handler applies to
$optionName string Option name
return Closure Closure
    private function getHandler($class, $optionName)
    {
        if (isset(HandlerLoader::$extraOptionHandlers[$class][$optionName])) {
            // Get the closure
            $closure = HandlerLoader::$extraOptionHandlers[$class][$optionName];
            $this->assertTrue(is_callable($closure));
            return $closure;
        } else {
            throw new \Exception(sprintf('Custom handler %s is not defined for class %s', $optionName, $class));
        }
    }