Skip to content

Commit

Permalink
refactor: final 4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
ddevsr committed May 20, 2024
1 parent 3cb145e commit da540d4
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 18 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Minimum PHP 8.1

## Install

This package is a [Rector](https://github.com/rectorphp/rector) extension developed by the Laravel community.
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.

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

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

return RectorConfig::configure()
->withSets([
CodeigniterSetList::CODEIGNITER_44
CodeigniterSetList::CODEIGNITER_45
]);
```

Expand Down
15 changes: 7 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"description": "Rector upgrades rules for Codeigniter4",
"require": {
"php": ">=8.1",
"rector/rector": "^1.0"
"rector/rector": "^1.0",
"codeigniter/phpstan-codeigniter": "^1.4",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan": "^1.11",
"phpstan/phpstan-strict-rules": "^1.6"
},
"require-dev": {
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan": "^1.10.2",
"phpstan/phpstan-strict-rules": "^1.5",
"phpunit/phpunit": "^10.5",
"codeigniter/phpstan-codeigniter": "^1.4",
"phpunit/phpunit": "^10.5.16",
"symplify/rule-doc-generator": "^12.1",
"codeigniter/coding-standard": "^1.7"
},
Expand Down Expand Up @@ -45,8 +45,7 @@
"sort-packages": true,
"allow-plugins": {
"rector/extension-installer": true,
"phpstan/extension-installer": true,
"cweagans/composer-patches": false
"phpstan/extension-installer": true
}
}
}
1 change: 0 additions & 1 deletion config/sets/codeigniter44.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
use Rector\Strict\Rector\If_\BooleanInIfConditionRuleFixerRector;
use Rector\TypeDeclaration\Rector\Empty_\EmptyOnNullableObjectToInstanceOfRector;

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

Expand Down
7 changes: 6 additions & 1 deletion config/sets/codeigniter45.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
use Rector\TypeDeclaration\Rector\Empty_\EmptyOnNullableObjectToInstanceOfRector;
use Rector\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector;

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

Expand Down Expand Up @@ -86,6 +85,12 @@
VersionCompareFuncCallToConstantRector::class,
]);

$rectorConfig->phpstanConfigs([
'./phpstan.neon.dist',
'./vendor/codeigniter/phpstan-codeigniter/extension.neon',
'./vendor/phpstan/phpstan-strict-rules/rules.neon',
]);

$rectorConfig
->ruleWithConfiguration(StringClassNameToClassConstantRector::class, [
// keep '\\' prefix string on string '\Foo\Bar'
Expand Down
1 change: 0 additions & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ parameters:
- */Fixture/*
- */Fixture*/*

checkGenericClassInNonGenericObjectType: false
checkMissingCallableSignature: true
treatPhpDocTypesAsCertain: false
strictRules:
Expand Down
5 changes: 0 additions & 5 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
])
->withParallel(120, 8, 10)
->withCache('/tmp/rector', FileCacheStorage::class)
->withPHPStanConfigs([
__DIR__ . '/phpstan.neon.dist',
__DIR__ . '/vendor/codeigniter/phpstan-codeigniter/extension.neon',
__DIR__ . '/vendor/phpstan/phpstan-strict-rules/rules.neon',
])
->withSkip([
// for tests
'*/Source/*',
Expand Down

0 comments on commit da540d4

Please sign in to comment.