From 18ed6de193ff23aa887e49ade4c029b89544dff9 Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Sat, 30 Aug 2014 15:23:30 +0200 Subject: [PATCH] Fixing more errors related to namespace changes --- src/Network/Response.php | 10 +++++----- src/Network/Socket.php | 6 +++--- src/ORM/Error/RecordNotFoundException.php | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Network/Response.php b/src/Network/Response.php index e0673236cd1..7247328f529 100644 --- a/src/Network/Response.php +++ b/src/Network/Response.php @@ -15,7 +15,7 @@ namespace Cake\Network; use Cake\Core\Configure; -use Cake\Error; +use Cake\Network\Exception\NotFoundException; use Cake\Utility\File; use InvalidArgumentException; use RuntimeException; @@ -1332,7 +1332,7 @@ protected function _normalizeCorsDomains($domains, $requestIsSSL = false) { * to a file, `APP` will be prepended to the path. * @param array $options Options See above. * @return void - * @throws \Cake\Error\NotFoundException + * @throws \Cake\Network\Exception\NotFoundException */ public function file($path, array $options = array()) { $options += array( @@ -1341,7 +1341,7 @@ public function file($path, array $options = array()) { ); if (strpos($path, '..') !== false) { - throw new Error\NotFoundException('The requested file contains `..` and will not be read.'); + throw new NotFoundException('The requested file contains `..` and will not be read.'); } if (!is_file($path)) { @@ -1351,9 +1351,9 @@ public function file($path, array $options = array()) { $file = new File($path); if (!$file->exists() || !$file->readable()) { if (Configure::read('debug')) { - throw new Error\NotFoundException(sprintf('The requested file %s was not found or not readable', $path)); + throw new NotFoundException(sprintf('The requested file %s was not found or not readable', $path)); } - throw new Error\NotFoundException(__d('cake', 'The requested file was not found')); + throw new NotFoundException(__d('cake', 'The requested file was not found')); } $extension = strtolower($file->ext()); diff --git a/src/Network/Socket.php b/src/Network/Socket.php index 4e51d10edd7..1a20871a3e7 100644 --- a/src/Network/Socket.php +++ b/src/Network/Socket.php @@ -354,7 +354,7 @@ public function reset($state = null) { * @param bool $enable enable or disable encryption. Default is true (enable) * @return bool True on success * @throws \InvalidArgumentException When an invalid encryption scheme is chosen. - * @throws \Cake\Network\Error\SocketException When attempting to enable SSL/TLS fails + * @throws \Cake\Network\Exception\SocketException When attempting to enable SSL/TLS fails * @see stream_socket_enable_crypto */ public function enableCrypto($type, $clientOrServer = 'client', $enable = true) { @@ -366,7 +366,7 @@ public function enableCrypto($type, $clientOrServer = 'client', $enable = true) $enableCryptoResult = stream_socket_enable_crypto($this->connection, $enable, $this->_encryptMethods[$type . '_' . $clientOrServer]); } catch (\Exception $e) { $this->setLastError(null, $e->getMessage()); - throw new Error\SocketException($e->getMessage()); + throw new SocketException($e->getMessage()); } if ($enableCryptoResult === true) { $this->encrypted = $enable; @@ -374,7 +374,7 @@ public function enableCrypto($type, $clientOrServer = 'client', $enable = true) } $errorMessage = 'Unable to perform enableCrypto operation on the current socket'; $this->setLastError(null, $errorMessage); - throw new Error\SocketException($errorMessage); + throw new SocketException($errorMessage); } } diff --git a/src/ORM/Error/RecordNotFoundException.php b/src/ORM/Error/RecordNotFoundException.php index 26d83fb2792..ccc330a4316 100644 --- a/src/ORM/Error/RecordNotFoundException.php +++ b/src/ORM/Error/RecordNotFoundException.php @@ -14,7 +14,7 @@ */ namespace Cake\ORM\Error; -use Cake\Error\NotFoundException; +use Cake\Network\Exception\NotFoundException; /** * Exception raised when a particular record was not found