Skip to content

Commit

Permalink
Add runtime deprecations for class aliases
Browse files Browse the repository at this point in the history
We added many class rename deprecations during 4.x but didn't include
runtime deprecations for them. Adding runtime deprecations in 4.5 will
encourage developers to update their code before the breaking change in
5.0

Refs cakephp/docs#7561
  • Loading branch information
markstory committed Dec 29, 2022
1 parent bb427cc commit 2219914
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 3 additions & 5 deletions ControllerFactory.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<?php
declare(strict_types=1);

class_alias(
'Cake\Controller\ControllerFactory',
'Cake\Http\ControllerFactory'
);
deprecationWarning(
'Use Cake\Controller\ControllerFactory instead of Cake\Http\ControllerFactory.'
'Since 4.2.0: Cake\Http\ControllerFactory is deprecated. ' .
'Use Cake\Controller\ControllerFactory instead.'
);
class_exists('Cake\Controller\ControllerFactory');
7 changes: 7 additions & 0 deletions TestSuite/HttpClientTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,10 @@ public function mockClientDelete(string $url, Response $response, array $options
Client::addMockResponse('DELETE', $url, $response, $options);
}
}

// phpcs:disable
class_alias(
'Cake\Http\TestSuite\HttpClientTrait',
'Cake\TestSuite\HttpClientTrait'
);
// phpcs:enable

0 comments on commit 2219914

Please sign in to comment.