From c67510b3d44197069bf0633c57a843d75e106d8b Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Mon, 23 Jan 2017 20:25:46 +0100 Subject: [PATCH] Fix namespace for exceptions (#13722) --- libraries/src/Joomla/Cms/Controller/Admin.php | 6 +++--- libraries/src/Joomla/Cms/Controller/Controller.php | 10 +++++----- libraries/src/Joomla/Cms/Controller/Form.php | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libraries/src/Joomla/Cms/Controller/Admin.php b/libraries/src/Joomla/Cms/Controller/Admin.php index 70b91c646c57e..2ba49971f83f3 100644 --- a/libraries/src/Joomla/Cms/Controller/Admin.php +++ b/libraries/src/Joomla/Cms/Controller/Admin.php @@ -54,7 +54,7 @@ class Admin extends Controller * * @see \JControllerLegacy * @since 1.6 - * @throws Exception + * @throws \Exception */ public function __construct($config = array()) { @@ -95,7 +95,7 @@ public function __construct($config = array()) if (!preg_match('/(.*)Controller(.*)/i', get_class($this), $r)) { - throw new Exception(\JText::_('JLIB_APPLICATION_ERROR_CONTROLLER_GET_NAME'), 500); + throw new \Exception(\JText::_('JLIB_APPLICATION_ERROR_CONTROLLER_GET_NAME'), 500); } $this->view_list = strtolower($r[2]); @@ -242,7 +242,7 @@ public function publish() $this->setMessage(\JText::plural($ntext, count($cid))); } } - catch (Exception $e) + catch (\Exception $e) { $this->setMessage($e->getMessage(), 'error'); } diff --git a/libraries/src/Joomla/Cms/Controller/Controller.php b/libraries/src/Joomla/Cms/Controller/Controller.php index fe6658214fd59..f2fd6f519a605 100644 --- a/libraries/src/Joomla/Cms/Controller/Controller.php +++ b/libraries/src/Joomla/Cms/Controller/Controller.php @@ -218,7 +218,7 @@ protected static function createFileName($type, $parts = array()) * @return \JControllerLegacy * * @since 3.0 - * @throws Exception if the controller cannot be loaded. + * @throws \Exception if the controller cannot be loaded. */ public static function getInstance($prefix, $config = array()) { @@ -567,7 +567,7 @@ protected function createModel($name, $prefix = '', $config = array()) * @return \JViewLegacy|null View object on success; null or error result on failure. * * @since 3.0 - * @throws Exception + * @throws \Exception */ protected function createView($name, $prefix = '', $type = '', $config = array()) { @@ -679,7 +679,7 @@ public function display($cachable = false, $urlparams = array()) * @return mixed The value returned by the called method. * * @since 3.0 - * @throws Exception + * @throws \Exception */ public function execute($task) { @@ -761,7 +761,7 @@ public function getModel($name = '', $prefix = '', $config = array()) * @return string The name of the dispatcher * * @since 3.0 - * @throws Exception + * @throws \Exception */ public function getName() { @@ -815,7 +815,7 @@ public function getTasks() * @return \JViewLegacy Reference to the view or an error. * * @since 3.0 - * @throws Exception + * @throws \Exception */ public function getView($name = '', $type = '', $prefix = '', $config = array()) { diff --git a/libraries/src/Joomla/Cms/Controller/Form.php b/libraries/src/Joomla/Cms/Controller/Form.php index 8289242f4f897..bd620669577c5 100644 --- a/libraries/src/Joomla/Cms/Controller/Form.php +++ b/libraries/src/Joomla/Cms/Controller/Form.php @@ -66,7 +66,7 @@ class Form extends Controller * * @see \JControllerLegacy * @since 1.6 - * @throws Exception + * @throws \Exception */ public function __construct($config = array()) { @@ -91,7 +91,7 @@ public function __construct($config = array()) if (!preg_match('/(.*)Controller(.*)/i', get_class($this), $r)) { - throw new Exception(\JText::_('JLIB_APPLICATION_ERROR_CONTROLLER_GET_NAME'), 500); + throw new \Exception(\JText::_('JLIB_APPLICATION_ERROR_CONTROLLER_GET_NAME'), 500); } $this->context = strtolower($r[2]); @@ -713,7 +713,7 @@ public function save($key = null, $urlVar = null) // Push up to three validation messages out to the user. for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) { - if ($errors[$i] instanceof Exception) + if ($errors[$i] instanceof \Exception) { $app->enqueueMessage($errors[$i]->getMessage(), 'warning'); }