Skip to content

Commit e40d9bc

Browse files
author
euromark
committed
Resolve Exception namespace
1 parent ef9a1e0 commit e40d9bc

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

src/Core/Configure.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use Cake\Cache\Cache;
1818
use Cake\Configure\ConfigEngineInterface;
1919
use Cake\Configure\Engine\PhpConfig;
20-
use Cake\Error;
20+
use Cake\Error\Exception;
2121
use Cake\Utility\Hash;
2222

2323
/**
@@ -283,10 +283,10 @@ public static function load($key, $config = 'default', $merge = true) {
283283
public static function dump($key, $config = 'default', $keys = []) {
284284
$engine = static::_getEngine($config);
285285
if (!$engine) {
286-
throw new Error\Exception(sprintf('There is no "%s" config engine.', $config));
286+
throw new Exception(sprintf('There is no "%s" config engine.', $config));
287287
}
288288
if (!method_exists($engine, 'dump')) {
289-
throw new Error\Exception(sprintf('The "%s" config engine, does not have a dump() method.', $config));
289+
throw new Exception(sprintf('The "%s" config engine, does not have a dump() method.', $config));
290290
}
291291
$values = static::$_values;
292292
if (!empty($keys) && is_array($keys)) {

src/Core/InstanceConfigTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
namespace Cake\Core;
1616

17-
use Cake\Error;
17+
use Cake\Error\Exception;
1818
use Cake\Utility\Hash;
1919

2020
/**
@@ -156,7 +156,7 @@ protected function _configWrite($key, $value, $merge = null) {
156156

157157
foreach ($stack as $k) {
158158
if (!is_array($update)) {
159-
throw new Error\Exception(sprintf('Cannot set %s value', $key));
159+
throw new Exception(sprintf('Cannot set %s value', $key));
160160
}
161161

162162
if (!isset($update[$k])) {
@@ -188,7 +188,7 @@ protected function _configDelete($key) {
188188

189189
foreach ($stack as $i => $k) {
190190
if (!is_array($update)) {
191-
throw new Error\Exception(sprintf('Cannot unset %s value', $key));
191+
throw new Exception(sprintf('Cannot unset %s value', $key));
192192
}
193193

194194
if (!isset($update[$k])) {

src/Core/StaticConfigTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
namespace Cake\Core;
1616

17-
use Cake\Error;
17+
use Cake\Error\Exception;
1818

1919
/**
2020
* A trait that provides a set of static methods to manage configuration
@@ -79,7 +79,7 @@ public static function config($key, $config = null) {
7979
return;
8080
}
8181
if (isset(static::$_config[$key])) {
82-
throw new Error\Exception(sprintf('Cannot reconfigure existing key "%s"', $key));
82+
throw new Exception(sprintf('Cannot reconfigure existing key "%s"', $key));
8383
}
8484
if (is_object($config)) {
8585
$config = ['className' => $config];

src/I18n/I18n.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
use Cake\Core\App;
2121
use Cake\Core\Configure;
2222
use Cake\Core\Plugin;
23-
use Cake\Error;
23+
use Cake\Error\Exception;
2424
use Cake\Network\Request;
2525
use Cake\Network\Session;
2626
use Cake\Utility\Hash;
@@ -239,7 +239,7 @@ public static function translate($singular, $plural = null, $domain = null, $cat
239239
$domain = static::$defaultDomain;
240240
}
241241
if ($domain === '') {
242-
throw new Error\Exception('You cannot use "" as a domain.');
242+
throw new Exception('You cannot use "" as a domain.');
243243
}
244244

245245
$_this->domain = $domain . '_' . $_this->l10n->lang;

src/Utility/Debugger.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
namespace Cake\Utility;
1616

1717
use Cake\Core\Configure;
18-
use Cake\Error;
18+
use Cake\Error\Exception;
1919
use Cake\Log\Log;
2020

2121
/**
@@ -627,7 +627,7 @@ public static function outputAs($format = null) {
627627
return $self->_outputFormat;
628628
}
629629
if ($format !== false && !isset($self->_templates[$format])) {
630-
throw new Error\Exception('Invalid Debugger output format.');
630+
throw new Exception('Invalid Debugger output format.');
631631
}
632632
$self->_outputFormat = $format;
633633
}

src/Utility/Number.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
namespace Cake\Utility;
2020

21-
use Cake\Error;
21+
use Cake\Error\Exception;
2222

2323
/**
2424
* Number helper library.
@@ -161,7 +161,7 @@ public static function fromReadableSize($size, $default = false) {
161161
if ($default !== false) {
162162
return $default;
163163
}
164-
throw new Error\Exception('No unit type.');
164+
throw new Exception('No unit type.');
165165
}
166166

167167
/**

src/Utility/Security.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
namespace Cake\Utility;
1818

1919
use Cake\Core\Configure;
20-
use Cake\Error;
20+
use Cake\Error\Exception;
2121

2222
/**
2323
* Security Library contains utility methods related to security
@@ -139,7 +139,7 @@ public static function setHash($hash) {
139139
*/
140140
public static function setCost($cost) {
141141
if ($cost < 4 || $cost > 31) {
142-
throw new Error\Exception(vsprintf(
142+
throw new Exception(vsprintf(
143143
'Invalid value, cost must be between %s and %s',
144144
array(4, 31)
145145
));
@@ -158,13 +158,13 @@ public static function setCost($cost) {
158158
*/
159159
public static function rijndael($text, $key, $operation) {
160160
if (empty($key)) {
161-
throw new Error\Exception('You cannot use an empty key for Security::rijndael()');
161+
throw new Exception('You cannot use an empty key for Security::rijndael()');
162162
}
163163
if (empty($operation) || !in_array($operation, array('encrypt', 'decrypt'))) {
164-
throw new Error\Exception('You must specify the operation for Security::rijndael(), either encrypt or decrypt');
164+
throw new Exception('You must specify the operation for Security::rijndael(), either encrypt or decrypt');
165165
}
166166
if (strlen($key) < 32) {
167-
throw new Error\Exception('You must use a key larger than 32 bytes for Security::rijndael()');
167+
throw new Exception('You must use a key larger than 32 bytes for Security::rijndael()');
168168
}
169169
$algorithm = MCRYPT_RIJNDAEL_256;
170170
$mode = MCRYPT_MODE_CBC;
@@ -213,7 +213,7 @@ protected static function _crypt($password, $salt = false) {
213213
}
214214

215215
if ($salt === true || strpos($salt, '$2y$') !== 0 || strlen($salt) < 29) {
216-
throw new Error\Exception(sprintf(
216+
throw new Exception(sprintf(
217217
'Invalid salt: %s for blowfish Please visit http://www.php.net/crypt and read the appropriate section for building blowfish salts.',
218218
$salt
219219
));
@@ -264,7 +264,7 @@ public static function encrypt($plain, $key, $hmacSalt = null) {
264264
*/
265265
protected static function _checkKey($key, $method) {
266266
if (strlen($key) < 32) {
267-
throw new Error\Exception(sprintf('Invalid key for %s, key must be at least 256 bits (32 bytes) long.', $method));
267+
throw new Exception(sprintf('Invalid key for %s, key must be at least 256 bits (32 bytes) long.', $method));
268268
}
269269
}
270270

@@ -280,7 +280,7 @@ protected static function _checkKey($key, $method) {
280280
public static function decrypt($cipher, $key, $hmacSalt = null) {
281281
self::_checkKey($key, 'decrypt()');
282282
if (empty($cipher)) {
283-
throw new Error\Exception('The data to decrypt cannot be empty.');
283+
throw new Exception('The data to decrypt cannot be empty.');
284284
}
285285
if ($hmacSalt === null) {
286286
$hmacSalt = Configure::read('Security.salt');

0 commit comments

Comments
 (0)