Skip to content

Commit da540d4

Browse files
committed
refactor: final 4.5
1 parent 3cb145e commit da540d4

File tree

6 files changed

+15
-18
lines changed

6 files changed

+15
-18
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Minimum PHP 8.1
1212

1313
## Install
1414

15-
This package is a [Rector](https://github.com/rectorphp/rector) extension developed by the Laravel community.
15+
This package is a [Rector](https://github.com/rectorphp/rector) extension developed by the PHPDevsr based on Codeigniter4 Community. In set `4.5` required `PHPStan`, you needed create `phpstan.neon.dist` in root project.
1616

1717
Install the `PHPDevsr\Rector\Codeigniter4` package as dependency:
1818

@@ -34,7 +34,7 @@ use PHPDevsr\Rector\Codeigniter4\Set\CodeigniterSetList;
3434

3535
return RectorConfig::configure()
3636
->withSets([
37-
CodeigniterSetList::CODEIGNITER_44
37+
CodeigniterSetList::CODEIGNITER_45
3838
]);
3939
```
4040

composer.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
"description": "Rector upgrades rules for Codeigniter4",
66
"require": {
77
"php": ">=8.1",
8-
"rector/rector": "^1.0"
8+
"rector/rector": "^1.0",
9+
"codeigniter/phpstan-codeigniter": "^1.4",
10+
"phpstan/extension-installer": "^1.3",
11+
"phpstan/phpstan": "^1.11",
12+
"phpstan/phpstan-strict-rules": "^1.6"
913
},
1014
"require-dev": {
11-
"phpstan/extension-installer": "^1.3",
12-
"phpstan/phpstan": "^1.10.2",
13-
"phpstan/phpstan-strict-rules": "^1.5",
14-
"phpunit/phpunit": "^10.5",
15-
"codeigniter/phpstan-codeigniter": "^1.4",
15+
"phpunit/phpunit": "^10.5.16",
1616
"symplify/rule-doc-generator": "^12.1",
1717
"codeigniter/coding-standard": "^1.7"
1818
},
@@ -45,8 +45,7 @@
4545
"sort-packages": true,
4646
"allow-plugins": {
4747
"rector/extension-installer": true,
48-
"phpstan/extension-installer": true,
49-
"cweagans/composer-patches": false
48+
"phpstan/extension-installer": true
5049
}
5150
}
5251
}

config/sets/codeigniter44.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
use Rector\Strict\Rector\If_\BooleanInIfConditionRuleFixerRector;
4040
use Rector\TypeDeclaration\Rector\Empty_\EmptyOnNullableObjectToInstanceOfRector;
4141

42-
// see: https://laravel.com/docs/5.0/upgrade
4342
return static function (RectorConfig $rectorConfig): void {
4443
$rectorConfig->import(__DIR__ . '/../config.php');
4544

config/sets/codeigniter45.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
use Rector\TypeDeclaration\Rector\Empty_\EmptyOnNullableObjectToInstanceOfRector;
4141
use Rector\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector;
4242

43-
// see: https://laravel.com/docs/5.0/upgrade
4443
return static function (RectorConfig $rectorConfig): void {
4544
$rectorConfig->import(__DIR__ . '/../config.php');
4645

@@ -86,6 +85,12 @@
8685
VersionCompareFuncCallToConstantRector::class,
8786
]);
8887

88+
$rectorConfig->phpstanConfigs([
89+
'./phpstan.neon.dist',
90+
'./vendor/codeigniter/phpstan-codeigniter/extension.neon',
91+
'./vendor/phpstan/phpstan-strict-rules/rules.neon',
92+
]);
93+
8994
$rectorConfig
9095
->ruleWithConfiguration(StringClassNameToClassConstantRector::class, [
9196
// keep '\\' prefix string on string '\Foo\Bar'

phpstan.neon.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ parameters:
1414
- */Fixture/*
1515
- */Fixture*/*
1616

17-
checkGenericClassInNonGenericObjectType: false
1817
checkMissingCallableSignature: true
1918
treatPhpDocTypesAsCertain: false
2019
strictRules:

rector.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@
1919
])
2020
->withParallel(120, 8, 10)
2121
->withCache('/tmp/rector', FileCacheStorage::class)
22-
->withPHPStanConfigs([
23-
__DIR__ . '/phpstan.neon.dist',
24-
__DIR__ . '/vendor/codeigniter/phpstan-codeigniter/extension.neon',
25-
__DIR__ . '/vendor/phpstan/phpstan-strict-rules/rules.neon',
26-
])
2722
->withSkip([
2823
// for tests
2924
'*/Source/*',

0 commit comments

Comments
 (0)