diff options
Diffstat (limited to 'phpBB/phpbb/controller')
-rw-r--r-- | phpBB/phpbb/controller/exception.php | 4 | ||||
-rw-r--r-- | phpBB/phpbb/controller/helper.php | 16 | ||||
-rw-r--r-- | phpBB/phpbb/controller/provider.php | 6 | ||||
-rw-r--r-- | phpBB/phpbb/controller/resolver.php | 30 |
4 files changed, 32 insertions, 24 deletions
diff --git a/phpBB/phpbb/controller/exception.php b/phpBB/phpbb/controller/exception.php index faa8b6b584..e8694b8bcf 100644 --- a/phpBB/phpbb/controller/exception.php +++ b/phpBB/phpbb/controller/exception.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\controller; + /** * @ignore */ @@ -19,6 +21,6 @@ if (!defined('IN_PHPBB')) * Controller exception class * @package phpBB3 */ -class phpbb_controller_exception extends RuntimeException +class exception extends \RuntimeException { } diff --git a/phpBB/phpbb/controller/helper.php b/phpBB/phpbb/controller/helper.php index 74410ddfd1..f1cc29f21b 100644 --- a/phpBB/phpbb/controller/helper.php +++ b/phpBB/phpbb/controller/helper.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\controller; + /** * @ignore */ @@ -21,17 +23,17 @@ use Symfony\Component\HttpFoundation\Response; * Controller helper class, contains methods that do things for controllers * @package phpBB3 */ -class phpbb_controller_helper +class helper { /** * Template object - * @var phpbb_template + * @var \phpbb\template\template */ protected $template; /** * User object - * @var phpbb_user + * @var \phpbb\user */ protected $user; @@ -50,12 +52,12 @@ class phpbb_controller_helper /** * Constructor * - * @param phpbb_template $template Template object - * @param phpbb_user $user User object + * @param \phpbb\template\template $template Template object + * @param \phpbb\user $user User object * @param string $phpbb_root_path phpBB root path * @param string $php_ext PHP extension */ - public function __construct(phpbb_template $template, phpbb_user $user, $phpbb_root_path, $php_ext) + public function __construct(\phpbb\template\template $template, \phpbb\user $user, $phpbb_root_path, $php_ext) { $this->template = $template; $this->user = $user; @@ -81,7 +83,7 @@ class phpbb_controller_helper page_footer(true, false, false); - return new Response($this->template->assign_display('body'), $status_code); + return new \Response($this->template->assign_display('body'), $status_code); } /** diff --git a/phpBB/phpbb/controller/provider.php b/phpBB/phpbb/controller/provider.php index b2a5b9f6b2..3aad08e3aa 100644 --- a/phpBB/phpbb/controller/provider.php +++ b/phpBB/phpbb/controller/provider.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\controller; + /** * @ignore */ @@ -23,7 +25,7 @@ use Symfony\Component\Config\FileLocator; * Controller interface * @package phpBB3 */ -class phpbb_controller_provider +class provider { /** * YAML file(s) containing route information @@ -48,7 +50,7 @@ class phpbb_controller_provider * * @return The current instance of this object for method chaining */ - public function import_paths_from_finder(phpbb_extension_finder $finder) + public function import_paths_from_finder(\phpbb\extension\finder $finder) { // We hardcode the path to the core config directory // because the finder cannot find it diff --git a/phpBB/phpbb/controller/resolver.php b/phpBB/phpbb/controller/resolver.php index 95dfc8da8e..5c1f5e836e 100644 --- a/phpBB/phpbb/controller/resolver.php +++ b/phpBB/phpbb/controller/resolver.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\controller; + /** * @ignore */ @@ -23,11 +25,11 @@ use Symfony\Component\HttpFoundation\Request; * Controller manager class * @package phpBB3 */ -class phpbb_controller_resolver implements ControllerResolverInterface +class resolver implements ControllerResolverInterface { /** * User object - * @var phpbb_user + * @var \phpbb\user */ protected $user; @@ -38,19 +40,19 @@ class phpbb_controller_resolver implements ControllerResolverInterface protected $container; /** - * phpbb_style object - * @var phpbb_style + * \phpbb\style\style object + * @var \phpbb\style\style */ protected $style; /** * Construct method * - * @param phpbb_user $user User Object + * @param \phpbb\user $user User Object * @param ContainerInterface $container ContainerInterface object - * @param phpbb_style $style + * @param \phpbb\style\style $style */ - public function __construct(phpbb_user $user, ContainerInterface $container, phpbb_style $style = null) + public function __construct(\phpbb\user $user, ContainerInterface $container, \phpbb\style\style $style = null) { $this->user = $user; $this->container = $container; @@ -62,7 +64,7 @@ class phpbb_controller_resolver implements ControllerResolverInterface * * @param Symfony\Component\HttpFoundation\Request $request Symfony Request object * @return bool|Callable Callable or false - * @throws phpbb_controller_exception + * @throws \phpbb\controller\exception */ public function getController(Request $request) { @@ -70,20 +72,20 @@ class phpbb_controller_resolver implements ControllerResolverInterface if (!$controller) { - throw new phpbb_controller_exception($this->user->lang['CONTROLLER_NOT_SPECIFIED']); + throw new \phpbb\controller\exception($this->user->lang['CONTROLLER_NOT_SPECIFIED']); } // Require a method name along with the service name if (stripos($controller, ':') === false) { - throw new phpbb_controller_exception($this->user->lang['CONTROLLER_METHOD_NOT_SPECIFIED']); + throw new \phpbb\controller\exception($this->user->lang['CONTROLLER_METHOD_NOT_SPECIFIED']); } list($service, $method) = explode(':', $controller); if (!$this->container->has($service)) { - throw new phpbb_controller_exception($this->user->lang('CONTROLLER_SERVICE_UNDEFINED', $service)); + throw new \phpbb\controller\exception($this->user->lang('CONTROLLER_SERVICE_UNDEFINED', $service)); } $controller_object = $this->container->get($service); @@ -118,13 +120,13 @@ class phpbb_controller_resolver implements ControllerResolverInterface * @param Symfony\Component\HttpFoundation\Request $request Symfony Request object * @param mixed $controller A callable (controller class, method) * @return bool False - * @throws phpbb_controller_exception + * @throws \phpbb\controller\exception */ public function getArguments(Request $request, $controller) { // At this point, $controller contains the object and method name list($object, $method) = $controller; - $mirror = new ReflectionMethod($object, $method); + $mirror = new \ReflectionMethod($object, $method); $arguments = array(); $parameters = $mirror->getParameters(); @@ -145,7 +147,7 @@ class phpbb_controller_resolver implements ControllerResolverInterface } else { - throw new phpbb_controller_exception($this->user->lang('CONTROLLER_ARGUMENT_VALUE_MISSING', $param->getPosition() + 1, get_class($object) . ':' . $method, $param->name)); + throw new \phpbb\controller\exception($this->user->lang('CONTROLLER_ARGUMENT_VALUE_MISSING', $param->getPosition() + 1, get_class($object) . ':' . $method, $param->name)); } } |