src/Listener/InjectModuleListener.php
protected function resolveModule($controller)
    {
        $modules = $this->getModules();

        $module = get_class($controller);
        while (false !== $pos = strrpos($module, '\\')) {
            $module = substr($module, 0, $pos);
            if ($modules->has($module)) {
                return $module;
            }
        }

        throw new RuntimeException(sprintf(
            'Failed to resolve the module namespace of the "%s" controller.',
            get_class($controller)
        ));
    }
protected function resolveModule($controller)
    {
        $modules = $this->getModules();

        $module = get_class($controller);
        while (false !== $pos = strrpos($module, '\\')) {
            $module = substr($module, 0, $pos);
            if ($modules->has($module)) {
                return $module;
            }
        }

        throw new RuntimeException(sprintf(
            'Failed to resolve the module namespace of the "%s" controller.',
            get_class($controller)
        ));
    }
protected function resolveModule ( $ controller ) { $ modules = $ this -> getModules ( ) ; $ module = get_class ( $ controller ) ; while ( false !== $ pos = strrpos ( $ module , '\\' ) ) { $ module = substr ( $ module , 0 , $ pos ) ; if ( $ modules -> has ( $ module ) ) { return $ module ; } } throw new RuntimeException ( sprintf ( 'Failed to resolve the module namespace of the "%s" controller.' , get_class ( $ controller ) ) ) ; }
Resolves the module namespace of received controller.

@param object $controller The controller

@throws \RuntimeException If failed to resolve the module namespace

@return string The module namespace
Resolves the module namespace of received controller .