Skip to content

Commit 3e0075e

Browse files
committed
Added downgrade sets for Rector, targetting PHP 7.4 and Symfony 5
1 parent b6002ac commit 3e0075e

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

composer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
"url": "https://updates.ibexa.co"
1212
}
1313
],
14+
"require": {
15+
"php": "^7.4 || ^8.0"
16+
},
1417
"require-dev": {
1518
"ibexa/automated-translation": "4.6.x-dev",
1619
"ibexa/code-style": "^1.0",
@@ -77,7 +80,8 @@
7780
"ibexa/share": "~4.6.x-dev",
7881
"ibexa/phpstan": "~4.6.-dev",
7982
"ibexa/cdp": "~4.6.x-dev",
80-
"ibexa/image-editor": "~4.6.x-dev"
83+
"ibexa/image-editor": "~4.6.x-dev",
84+
"ibexa/rector": "~4.6.x-dev"
8185
},
8286
"scripts": {
8387
"fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots",

rector.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
/**
4+
* @copyright Copyright (C) Ibexa AS. All rights reserved.
5+
* @license For full copyright and license information view LICENSE file distributed with this source code.
6+
*/
7+
declare(strict_types=1);
8+
9+
use Rector\Config\RectorConfig;
10+
use Ibexa\Contracts\Rector\Sets\IbexaSetList;
11+
use Rector\Symfony\DowngradeSymfony70\Rector\Class_\DowngradeSymfonyCommandAttributeRector;
12+
use Rector\DowngradePhp82\Rector\FuncCall\DowngradeIteratorCountToArrayRector;
13+
14+
return RectorConfig::configure()
15+
->withPaths([
16+
__DIR__ . '/code_samples',
17+
])
18+
->withSkip([
19+
DowngradeIteratorCountToArrayRector::class,
20+
])
21+
->withSets([
22+
IbexaSetList::IBEXA_46->value,
23+
])
24+
->withDowngradeSets(php74: true)
25+
->withRules([
26+
DowngradeSymfonyCommandAttributeRector::class,
27+
]);

0 commit comments

Comments
 (0)