dereuromark 8 years ago
parent
commit
bea2b908ff

+ 3 - 3
src/Database/Connection.php

@@ -223,7 +223,7 @@ class Connection implements ConnectionInterface
     {
         try {
             return $this->_driver->connect();
-        } catch (\Exception $e) {
+        } catch (Exception $e) {
             throw new MissingConnectionException(['reason' => $e->getMessage()]);
         }
     }
@@ -679,7 +679,7 @@ class Connection implements ConnectionInterface
 
         try {
             $result = $callback($this);
-        } catch (\Exception $e) {
+        } catch (Exception $e) {
             $this->rollback(false);
             throw $e;
         }
@@ -727,7 +727,7 @@ class Connection implements ConnectionInterface
 
         try {
             $result = $callback($this);
-        } catch (\Exception $e) {
+        } catch (Exception $e) {
             $this->enableForeignKeys();
             throw $e;
         }

+ 2 - 1
src/Database/Driver/PDODriverTrait.php

@@ -17,6 +17,7 @@ namespace Cake\Database\Driver;
 use Cake\Database\Query;
 use Cake\Database\Statement\PDOStatement;
 use PDO;
+use PDOException;
 
 /**
  * PDO driver trait
@@ -90,7 +91,7 @@ trait PDODriverTrait
         } else {
             try {
                 $connected = $this->_connection->query('SELECT 1');
-            } catch (\PDOException $e) {
+            } catch (PDOException $e) {
                 $connected = false;
             }
         }

+ 2 - 1
src/Shell/CacheShell.php

@@ -18,6 +18,7 @@ use Cake\Cache\Cache;
 use Cake\Cache\Engine\ApcEngine;
 use Cake\Cache\Engine\WincacheEngine;
 use Cake\Console\Shell;
+use InvalidArgumentException;
 
 /**
  * Cache Shell.
@@ -84,7 +85,7 @@ class CacheShell extends Shell
             } else {
                 $this->out("<success>Cleared $prefix cache</success>");
             }
-        } catch (\InvalidArgumentException $e) {
+        } catch (InvalidArgumentException $e) {
             $this->abort($e->getMessage());
         }
     }

+ 2 - 1
src/TestSuite/IntegrationTestCase.php

@@ -32,6 +32,7 @@ use Cake\Utility\Text;
 use Cake\View\Helper\SecureFieldTokenTrait;
 use Exception;
 use LogicException;
+use PHPUnit\Exception as PhpunitException;
 
 /**
  * A test case class intended to make integration tests of
@@ -487,7 +488,7 @@ abstract class IntegrationTestCase extends TestCase
                 $this->_requestSession->write('Flash', $this->_flashMessages);
             }
             $this->_response = $response;
-        } catch (\PHPUnit\Exception $e) {
+        } catch (PhpUnitException $e) {
             throw $e;
         } catch (DatabaseException $e) {
             throw $e;