Skip to content

Commit

Permalink
Fix namespace for exceptions (#13722)
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo authored and wilsonge committed Jan 23, 2017
1 parent de9f8a4 commit c67510b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions libraries/src/Joomla/Cms/Controller/Admin.php
Expand Up @@ -54,7 +54,7 @@ class Admin extends Controller
*
* @see \JControllerLegacy
* @since 1.6
* @throws Exception
* @throws \Exception
*/
public function __construct($config = array())
{
Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -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');
}
Expand Down
10 changes: 5 additions & 5 deletions libraries/src/Joomla/Cms/Controller/Controller.php
Expand Up @@ -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())
{
Expand Down Expand Up @@ -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())
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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()
{
Expand Down Expand Up @@ -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())
{
Expand Down
6 changes: 3 additions & 3 deletions libraries/src/Joomla/Cms/Controller/Form.php
Expand Up @@ -66,7 +66,7 @@ class Form extends Controller
*
* @see \JControllerLegacy
* @since 1.6
* @throws Exception
* @throws \Exception
*/
public function __construct($config = array())
{
Expand All @@ -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]);
Expand Down Expand Up @@ -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');
}
Expand Down

0 comments on commit c67510b

Please sign in to comment.