Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
try {
Configure::config('default', new PhpConfig());
Configure::load('app', 'default', false);
} catch (\Exception $e) {
} catch (Exception $e) {
exit($e->getMessage() . "\n");
}

Expand Down
11 changes: 9 additions & 2 deletions config/rector/cakephp3.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
<?php
declare(strict_types=1);

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

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([CakePHPSetList::CAKEPHP_30, CakePHPSetList::CAKEPHP_34, CakePHPSetList::CAKEPHP_35, CakePHPSetList::CAKEPHP_36, CakePHPSetList::CAKEPHP_37, CakePHPSetList::CAKEPHP_38]);
$rectorConfig->sets([
CakePHPSetList::CAKEPHP_30,
CakePHPSetList::CAKEPHP_34,
CakePHPSetList::CAKEPHP_35,
CakePHPSetList::CAKEPHP_36,
CakePHPSetList::CAKEPHP_37,
CakePHPSetList::CAKEPHP_38,
]);
};
2 changes: 1 addition & 1 deletion config/rector/cakephp40.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

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

return static function (RectorConfig $rectorConfig): void {
Expand Down
2 changes: 1 addition & 1 deletion config/rector/cakephp41.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

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

return static function (RectorConfig $rectorConfig): void {
Expand Down
2 changes: 1 addition & 1 deletion config/rector/cakephp42.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

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

return static function (RectorConfig $rectorConfig): void {
Expand Down
2 changes: 1 addition & 1 deletion config/rector/cakephp43.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

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

return static function (RectorConfig $rectorConfig): void {
Expand Down
2 changes: 1 addition & 1 deletion config/rector/cakephp44.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

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

return static function (RectorConfig $rectorConfig): void {
Expand Down
2 changes: 1 addition & 1 deletion config/rector/cakephp45.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

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

return static function (RectorConfig $rectorConfig): void {
Expand Down
2 changes: 1 addition & 1 deletion config/rector/cakephp50.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

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

return static function (RectorConfig $rectorConfig): void {
Expand Down
2 changes: 1 addition & 1 deletion config/rector/cakephp51.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

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

return static function (RectorConfig $rectorConfig): void {
Expand Down
2 changes: 1 addition & 1 deletion config/rector/cakephp52.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

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

return static function (RectorConfig $rectorConfig): void {
Expand Down
2 changes: 1 addition & 1 deletion config/rector/cakephp53.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

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

return static function (RectorConfig $rectorConfig): void {
Expand Down
2 changes: 1 addition & 1 deletion config/rector/cakephp60.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

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

return static function (RectorConfig $rectorConfig): void {
Expand Down
2 changes: 1 addition & 1 deletion config/rector/chronos3.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

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

return static function (RectorConfig $rectorConfig): void {
Expand Down
2 changes: 1 addition & 1 deletion config/rector/migrations45.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

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

return static function (RectorConfig $rectorConfig): void {
Expand Down
6 changes: 3 additions & 3 deletions config/rector/sets/cakephp-fluent-options.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
declare(strict_types=1);

use Cake\Upgrade\Rector\Rector\MethodCall\ArrayToFluentCallRector;
use Cake\Upgrade\Rector\ValueObject\ArrayToFluentCall;
use Cake\Upgrade\Rector\ValueObject\FactoryMethod;
use Cake\Upgrade\Rector\Cake3\ArrayToFluentCall\ArrayToFluentCall;
use Cake\Upgrade\Rector\Cake3\ArrayToFluentCall\ArrayToFluentCallRector;
use Cake\Upgrade\Rector\Cake3\ArrayToFluentCall\FactoryMethod;
use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void {
Expand Down
2 changes: 1 addition & 1 deletion config/rector/sets/cakephp30.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

use Cake\Upgrade\Rector\Rector\Namespace_\AppUsesStaticCallToUseStatementRector;
use Cake\Upgrade\Rector\Cake3\AppUsesStaticCallToUseStatementRector;
use Rector\Config\RectorConfig;
use Rector\Renaming\Rector\Name\RenameClassRector;

Expand Down
12 changes: 6 additions & 6 deletions config/rector/sets/cakephp34.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
declare(strict_types=1);

use Cake\Upgrade\Rector\Rector\MethodCall\ModalToGetSetRector;
use Cake\Upgrade\Rector\ValueObject\ModalToGetSet;
use Cake\Upgrade\Rector\Cake3\ModalToGetSet\ModalToGetSet;
use Cake\Upgrade\Rector\Cake3\ModalToGetSet\ModalToGetSetRector;
use Rector\Config\RectorConfig;
use Rector\ValueObject\Visibility;
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
use Rector\Renaming\Rector\Name\RenameClassRector;
use Rector\Renaming\Rector\PropertyFetch\RenamePropertyRector;
use Rector\Renaming\ValueObject\MethodCallRename;
use Rector\Renaming\ValueObject\RenameProperty;
use Rector\Transform\Rector\Assign\PropertyFetchToMethodCallRector;
use Rector\Transform\ValueObject\PropertyFetchToMethodCall;
use Rector\ValueObject\Visibility;
use Rector\Visibility\Rector\ClassMethod\ChangeMethodVisibilityRector;
use Rector\Visibility\ValueObject\ChangeMethodVisibility;

Expand All @@ -29,7 +29,7 @@

$rectorConfig->ruleWithConfiguration(
RenamePropertyRector::class,
[new RenameProperty('Cake\Network\Request', '_session', 'session')]
[new RenameProperty('Cake\Network\Request', '_session', 'session')],
);

$rectorConfig->ruleWithConfiguration(ModalToGetSetRector::class, [
Expand All @@ -47,7 +47,7 @@
'Cake\Database\Expression\QueryExpression',
'tieWith',
'getConjunction',
'setConjunction'
'setConjunction',
),
new ModalToGetSet('Cake\Database\Expression\ValuesExpression', 'columns'),
new ModalToGetSet('Cake\Database\Expression\ValuesExpression', 'values'),
Expand All @@ -58,7 +58,7 @@
'Cake\Database\Query',
'bufferResults',
'isBufferedResultsEnabled',
'enableBufferedResults'
'enableBufferedResults',
),
new ModalToGetSet('Cake\Database\Schema\CachedCollection', 'cacheMetadata'),
new ModalToGetSet('Cake\Database\Schema\TableSchema', 'options'),
Expand Down
4 changes: 2 additions & 2 deletions config/rector/sets/cakephp35.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
declare(strict_types=1);

use Cake\Upgrade\Rector\Rector\MethodCall\ModalToGetSetRector;
use Cake\Upgrade\Rector\ValueObject\ModalToGetSet;
use Cake\Upgrade\Rector\Cake3\ModalToGetSet\ModalToGetSet;
use Cake\Upgrade\Rector\Cake3\ModalToGetSet\ModalToGetSetRector;
use Rector\Config\RectorConfig;
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
use Rector\Renaming\Rector\Name\RenameClassRector;
Expand Down
8 changes: 3 additions & 5 deletions config/rector/sets/cakephp37.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
<?php
declare(strict_types=1);

use Cake\Upgrade\Rector\Rector\MethodCall\ModalToGetSetRector;
use Cake\Upgrade\Rector\Rector\Property\ChangeSnakedFixtureNameToPascalRector;
use Cake\Upgrade\Rector\ValueObject\ModalToGetSet;
use Cake\Upgrade\Rector\Cake3\ChangeSnakedFixtureNameToPascalRector;
use Cake\Upgrade\Rector\Cake3\ModalToGetSet\ModalToGetSet;
use Cake\Upgrade\Rector\Cake3\ModalToGetSet\ModalToGetSetRector;
use Rector\Config\RectorConfig;
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
use Rector\Renaming\ValueObject\MethodCallRename;
use Rector\Transform\Rector\Assign\PropertyFetchToMethodCallRector;
use Rector\Transform\Rector\MethodCall\MethodCallToAnotherMethodCallWithArgumentsRector;
use Rector\Transform\ValueObject\MethodCallToAnotherMethodCallWithArguments;
use Rector\Transform\ValueObject\PropertyFetchToMethodCall;

# source: https://book.cakephp.org/3.0/en/appendices/3-7-migration-guide.html
Expand Down
2 changes: 1 addition & 1 deletion config/rector/sets/cakephp38.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->ruleWithConfiguration(
RenameMethodRector::class,
[new MethodCallRename('Cake\ORM\Entity', 'visibleProperties', 'getVisible')]
[new MethodCallRename('Cake\ORM\Entity', 'visibleProperties', 'getVisible')],
);
};
14 changes: 7 additions & 7 deletions config/rector/sets/cakephp40.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php
declare(strict_types=1);

use Cake\Upgrade\Rector\Rector\ClassMethod\FormBuildValidatorRector;
use Cake\Upgrade\Rector\Rector\MethodCall\ModalToGetSetRector;
use Cake\Upgrade\Rector\Rector\MethodCall\NewEntityToNewEmptyEntityRector;
use Cake\Upgrade\Rector\Rector\MethodCall\PaginatorCounterFormatRector;
use Cake\Upgrade\Rector\Rector\MethodCall\RenameMethodCallBasedOnParameterRector;
use Cake\Upgrade\Rector\ValueObject\ModalToGetSet;
use Cake\Upgrade\Rector\ValueObject\RenameMethodCallBasedOnParameter;
use Cake\Upgrade\Rector\Cake3\ModalToGetSet\ModalToGetSet;
use Cake\Upgrade\Rector\Cake3\ModalToGetSet\ModalToGetSetRector;
use Cake\Upgrade\Rector\Cake4\FormBuildValidatorRector;
use Cake\Upgrade\Rector\Cake4\NewEntityToNewEmptyEntityRector;
use Cake\Upgrade\Rector\Cake4\PaginatorCounterFormatRector;
use Cake\Upgrade\Rector\Cake4\RenameMethodCallBasedOnParameter\RenameMethodCallBasedOnParameter;
use Cake\Upgrade\Rector\Cake4\RenameMethodCallBasedOnParameter\RenameMethodCallBasedOnParameterRector;
use PHPStan\Type\BooleanType;
use PHPStan\Type\IntegerType;
use PHPStan\Type\NullType;
Expand Down
6 changes: 3 additions & 3 deletions config/rector/sets/cakephp41.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
declare(strict_types=1);

use Cake\Upgrade\Rector\Rector\MethodCall\ModalToGetSetRector;
use Cake\Upgrade\Rector\ValueObject\ModalToGetSet;
use Cake\Upgrade\Rector\Cake3\ModalToGetSet\ModalToGetSet;
use Cake\Upgrade\Rector\Cake3\ModalToGetSet\ModalToGetSetRector;
use Rector\Config\RectorConfig;
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
use Rector\Renaming\Rector\Name\RenameClassRector;
Expand All @@ -23,7 +23,7 @@
new MethodCallRename(
'Cake\Http\Middleware\CsrfProtectionMiddleware',
'whitelistCallback',
'skipCheckCallback'
'skipCheckCallback',
),
]);

Expand Down
2 changes: 1 addition & 1 deletion config/rector/sets/cakephp42.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@

$rectorConfig->ruleWithConfiguration(
RenameMethodRector::class,
[new MethodCallRename('Cake\ORM\Behavior', 'getTable', 'table')]
[new MethodCallRename('Cake\ORM\Behavior', 'getTable', 'table')],
);
};
10 changes: 4 additions & 6 deletions config/rector/sets/cakephp43.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
<?php
declare(strict_types=1);

use Cake\Upgrade\Rector\Rector\MethodCall\RemoveIntermediaryMethodRector;
use Cake\Upgrade\Rector\ValueObject\RemoveIntermediaryMethod;
use Cake\Upgrade\Rector\Cake4\RemoveIntermediaryMethod\RemoveIntermediaryMethod;
use Cake\Upgrade\Rector\Cake4\RemoveIntermediaryMethod\RemoveIntermediaryMethodRector;
use Rector\Config\RectorConfig;
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
use Rector\Renaming\ValueObject\MethodCallRename;
use Rector\Transform\Rector\Assign\PropertyFetchToMethodCallRector;
use Rector\Transform\Rector\MethodCall\MethodCallToAnotherMethodCallWithArgumentsRector;
use Rector\Transform\ValueObject\MethodCallToAnotherMethodCallWithArguments;
use Rector\Transform\ValueObject\PropertyFetchToMethodCall;

# source: https://book.cakephp.org/4.next/en/appendices/4-3-migration-guide.html
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->ruleWithConfiguration(
RenameMethodRector::class,
[new MethodCallRename('Cake\Controller\Component', 'shutdown', 'afterFilter')]
[new MethodCallRename('Cake\Controller\Component', 'shutdown', 'afterFilter')],
);

$rectorConfig->ruleWithConfiguration(PropertyFetchToMethodCallRector::class, [
Expand All @@ -26,7 +24,7 @@

$rectorConfig->ruleWithConfiguration(
RemoveIntermediaryMethodRector::class,
[new RemoveIntermediaryMethod('getTableLocator', 'get', 'fetchTable')]
[new RemoveIntermediaryMethod('getTableLocator', 'get', 'fetchTable')],
);

// These rector rules were removed in rector 0.17 - see https://github.com/rectorphp/rector-src/pull/3777
Expand Down
5 changes: 2 additions & 3 deletions config/rector/sets/cakephp45.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
$rectorConfig->ruleWithConfiguration(RenameClassRector::class, [
'Cake\Datasource\Paging\Paginator' => 'Cake\Datasource\Paging\NumericPaginator',
'Cake\TestSuite\ContainerStubTrait' => 'Cake\Core\TestSuite\ContainerStubTrait',
'Cake\TestSuite\HttpClientTrait' => 'Cake\Http\TestSuite\HttpClientTrait',
'Cake\TestSuite\HttpClientTrait' => 'Cake\Http\TestSuite\HttpClientTrait',
'Cake\Cache\InvalidArgumentException' => 'Cake\Cache\Exception\InvalidArgumentException',
]);

Expand All @@ -20,7 +20,6 @@
[
new MethodCallRename('Cake\View\View', 'loadHelper', 'addHelper'),
new MethodCallRename('Cake\Validation\Validator', 'isArray', 'array'),
]
],
);

};
18 changes: 9 additions & 9 deletions config/rector/sets/cakephp50.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php
declare(strict_types=1);

use Cake\Upgrade\Rector\Rector\MethodCall\OptionsArrayToNamedParametersRector;
use Cake\Upgrade\Rector\Rector\MethodCall\RemoveMethodCallRector;
use Cake\Upgrade\Rector\Rector\MethodCall\TableRegistryLocatorRector;
use Cake\Upgrade\Rector\Rector\MethodCall\SetSerializeToViewBuilderRector;
use Cake\Upgrade\Rector\ValueObject\OptionsArrayToNamedParameters;
use Cake\Upgrade\Rector\ValueObject\RemoveMethodCall;
use Cake\Upgrade\Rector\ValueObject\SetSerializeToView;
use Cake\Upgrade\Rector\Cake5\OptionsArrayToNamedParameters\OptionsArrayToNamedParameters;
use Cake\Upgrade\Rector\Cake5\OptionsArrayToNamedParameters\OptionsArrayToNamedParametersRector;
use Cake\Upgrade\Rector\Cake5\RemoveMethodCall\RemoveMethodCall;
use Cake\Upgrade\Rector\Cake5\RemoveMethodCall\RemoveMethodCallRector;
use Cake\Upgrade\Rector\Cake5\SetSerializeToViewBuilder\SetSerializeToView;
use Cake\Upgrade\Rector\Cake5\SetSerializeToViewBuilder\SetSerializeToViewBuilderRector;
use Cake\Upgrade\Rector\Cake5\TableRegistryLocatorRector;
use PHPStan\Type\ArrayType;
use PHPStan\Type\BooleanType;
use PHPStan\Type\MixedType;
Expand All @@ -31,7 +31,7 @@
new OptionsArrayToNamedParameters('Cake\ORM\Query\SelectQuery', ['find']),
new OptionsArrayToNamedParameters('Cake\ORM\Association', ['find']),
new OptionsArrayToNamedParameters('Cake\ORM\Table', ['get', 'rename' => ['key' => 'cacheKey']]),
]
],
);

$arrayType = new ArrayType(new MixedType(), new MixedType());
Expand Down Expand Up @@ -96,7 +96,7 @@

// Mailer
new AddPropertyTypeDeclaration('Cake\Mailer\Mailer', 'name', $stringType),
]
],
);

$rectorConfig->ruleWithConfiguration(RenameClassRector::class, [
Expand Down
Loading
Loading