src/Vectorface/SnappyRouter/SnappyRouter.php
private function setupHandlers($handlers)
    {
        $this->handlers = array();
        foreach ($handlers as $handlerClass => $handlerDetails) {
            $options = array();
            if (isset($handlerDetails[Config::KEY_OPTIONS])) {
                $options = (array)$handlerDetails[Config::KEY_OPTIONS];
            }

            if (isset($handlerDetails[Config::KEY_CLASS])) {
                $handlerClass = $handlerDetails[Config::KEY_CLASS];
            }

            if (!class_exists($handlerClass)) {
                throw new Exception(
                    'Cannot instantiate instance of '.$handlerClass
                );
            }
            $this->handlers[] = new $handlerClass($options);
        }
    }
private function setupHandlers($handlers)
    {
        $this->handlers = array();
        foreach ($handlers as $handlerClass => $handlerDetails) {
            $options = array();
            if (isset($handlerDetails[Config::KEY_OPTIONS])) {
                $options = (array)$handlerDetails[Config::KEY_OPTIONS];
            }

            if (isset($handlerDetails[Config::KEY_CLASS])) {
                $handlerClass = $handlerDetails[Config::KEY_CLASS];
            }

            if (!class_exists($handlerClass)) {
                throw new Exception(
                    'Cannot instantiate instance of '.$handlerClass
                );
            }
            $this->handlers[] = new $handlerClass($options);
        }
    }
private function setupHandlers ( $ handlers ) { $ this -> handlers = array ( ) ; foreach ( $ handlers as $ handlerClass => $ handlerDetails ) { $ options = array ( ) ; if ( isset ( $ handlerDetails [ Config :: KEY_OPTIONS ] ) ) { $ options = ( array ) $ handlerDetails [ Config :: KEY_OPTIONS ] ; } if ( isset ( $ handlerDetails [ Config :: KEY_CLASS ] ) ) { $ handlerClass = $ handlerDetails [ Config :: KEY_CLASS ] ; } if ( ! class_exists ( $ handlerClass ) ) { throw new Exception ( 'Cannot instantiate instance of ' . $ handlerClass ) ; } $ this -> handlers [ ] = new $ handlerClass ( $ options ) ; } }
helper to setup the array of handlers
helper to setup the array of handlers