Skip to content

Commit 917a25a

Browse files
committed
apply rector set for cakephp
1 parent 3e26f42 commit 917a25a

16 files changed

+20
-32
lines changed

rector.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/Exception/MethodNotAllowedException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
* @package CakeDC\Api\Exception
2323
*/
24-
class MethodNotAllowedException extends Exception
24+
class MethodNotAllowedException extends \Cake\Core\Exception\CakeException
2525
{
2626
/**
2727
* MethodNotAllowedException constructor.

src/Exception/ServiceException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
* @package CakeDC\Api\Exception
2323
*/
24-
class ServiceException extends Exception
24+
class ServiceException extends \Cake\Core\Exception\CakeException
2525
{
2626
/**
2727
* ServiceException constructor.

src/Exception/UnauthenticatedException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
* @package CakeDC\Api\Exception
2323
*/
24-
class UnauthenticatedException extends Exception
24+
class UnauthenticatedException extends \Cake\Core\Exception\CakeException
2525
{
2626
/**
2727
* UnauthenticatedException constructor.

src/Exception/UnauthorizedException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*
2121
* @package CakeDC\Api\Exception
2222
*/
23-
class UnauthorizedException extends Exception
23+
class UnauthorizedException extends \Cake\Core\Exception\CakeException
2424
{
2525
/**
2626
* UnauthorizedException constructor.

src/Service/Auth/AuthenticateTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public function identify()
175175
* Loads the configured authentication objects.
176176
*
177177
* @return array|null The loaded authorization objects, or null on empty authenticate value.
178-
* @throws \Cake\Core\Exception\Exception
178+
* @throws \Cake\Core\Exception\CakeException
179179
*/
180180
public function constructAuthenticate()
181181
{
@@ -198,13 +198,13 @@ public function constructAuthenticate()
198198
}
199199
$className = App::className($class, 'Service/Auth/Authenticate', 'Authenticate');
200200
if (!class_exists($className)) {
201-
throw new Exception(sprintf('Authentication adapter "%s" was not found.', $class));
201+
throw new \Cake\Core\Exception\CakeException(sprintf('Authentication adapter "%s" was not found.', $class));
202202
}
203203
$config = array_merge($global, (array)$config);
204204

205205
$class = new $className($this->_action, $config);
206206
if (!method_exists($class, 'authenticate')) {
207-
throw new Exception('Authentication objects must implement an authenticate() method.');
207+
throw new \Cake\Core\Exception\CakeException('Authentication objects must implement an authenticate() method.');
208208
}
209209
$this->_authenticateObjects[$alias] = $class;
210210
$this->getEventManager()->on($class);

src/Service/Auth/AuthorizeTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function isAuthorized($user = null, ?ServerRequest $request = null)
9292
* Loads the authorization objects configured.
9393
*
9494
* @return array|null The loaded authorization objects, or null when authorize is empty.
95-
* @throws \Cake\Core\Exception\Exception
95+
* @throws \Cake\Core\Exception\CakeException
9696
*/
9797
public function constructAuthorize()
9898
{
@@ -115,12 +115,12 @@ public function constructAuthorize()
115115
}
116116
$className = App::className($class, 'Service/Auth/Authorize', 'Authorize');
117117
if (!class_exists($className)) {
118-
throw new Exception(sprintf('Authorization adapter "%s" was not found.', $class));
118+
throw new \Cake\Core\Exception\CakeException(sprintf('Authorization adapter "%s" was not found.', $class));
119119
}
120120
$config = (array)$config + $global;
121121
$class = new $className($this->_action, $config);
122122
if (!method_exists($class, 'authorize')) {
123-
throw new Exception('Authorization objects must implement an authorize() method.');
123+
throw new \Cake\Core\Exception\CakeException('Authorization objects must implement an authorize() method.');
124124
}
125125
$this->_authorizeObjects[$alias] = $class;
126126
}

src/Service/Auth/StorageTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function storage(?StorageInterface $storage = null)
7070
}
7171
$className = App::className($class, 'Auth/Storage', 'Storage');
7272
if (!class_exists($className)) {
73-
throw new Exception(sprintf('Auth storage adapter "%s" was not found.', $class));
73+
throw new \Cake\Core\Exception\CakeException(sprintf('Auth storage adapter "%s" was not found.', $class));
7474
}
7575
$this->_storage = new $className($this->request, $this->response, $config);
7676

src/Service/Exception/MissingActionException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
use Cake\Core\Exception\Exception;
1717

18-
class MissingActionException extends Exception
18+
class MissingActionException extends \Cake\Core\Exception\CakeException
1919
{
2020
protected $_messageTemplate = 'Action class %s could not be found.';
2121
}

src/Service/Exception/MissingExtensionException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
use Cake\Core\Exception\Exception;
1717

18-
class MissingExtensionException extends Exception
18+
class MissingExtensionException extends \Cake\Core\Exception\CakeException
1919
{
2020
protected $_messageTemplate = 'Extension class %s could not be found.';
2121
}

0 commit comments

Comments
 (0)