Skip to content

Commit

Permalink
Add rector for _cake_core_ deprecation.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Aug 15, 2024
1 parent dec40bc commit 41e7263
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
9 changes: 9 additions & 0 deletions config/rector/cakephp51.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
declare(strict_types=1);

use Cake\Upgrade\Rector\Set\CakePHPSetList;
use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([CakePHPSetList::CAKEPHP_51]);
};
14 changes: 14 additions & 0 deletions config/rector/sets/cakephp51.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Renaming\Rector\String_\RenameStringRector;

# @see https://book.cakephp.org/5/en/appendices/5-1-migration-guide.html
return static function (RectorConfig $rectorConfig): void {

$rectorConfig->ruleWithConfiguration(RenameStringRector::class, [
// Rename the cache configuration used by translations.
'_cake_core_' => '_cake_translations_',
]);
};
5 changes: 5 additions & 0 deletions src/Rector/Set/CakePHPSetList.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ final class CakePHPSetList implements SetListInterface
*/
public const CAKEPHP_50 = __DIR__ . '/../../../config/rector/sets/cakephp50.php';

/**
* @var string
*/
public const CAKEPHP_51 = __DIR__ . '/../../../config/rector/sets/cakephp51.php';

/**
* @var string
*/
Expand Down

0 comments on commit 41e7263

Please sign in to comment.