From 4c61fc1b673a695199469886d879f66537773716 Mon Sep 17 00:00:00 2001 From: Denny Septian Panggabean Date: Mon, 1 Apr 2024 21:16:28 +0700 Subject: [PATCH 1/7] fix: badge phpunit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bafe308..c687352 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Rector Rules for Codeigniter4 -[![Tests](https://github.com/PHPDevsr/rector-codeigniter4/actions/workflows/tests.yaml/badge.svg)](https://github.com/PHPDevsr/rector-codeigniter4/actions/workflows/test-phpunit.yaml) +[![Tests](https://github.com/PHPDevsr/rector-codeigniter4/actions/workflows/test-phpunit.yaml/badge.svg)](https://github.com/PHPDevsr/rector-codeigniter4/actions/workflows/test-phpunit.yaml) [![Code Analysis](https://github.com/PHPDevsr/rector-codeigniter4/actions/workflows/code_analysis.yaml/badge.svg)](https://github.com/PHPDevsr/rector-codeigniter4/actions/workflows/code_analysis.yaml) [![Packagist Downloads](https://img.shields.io/packagist/dm/PHPDevsr/rector-codeigniter4)](https://packagist.org/packages/PHPDevsr/rector-codeigniter4/stats) [![Packagist Version](https://img.shields.io/packagist/v/PHPDevsr/rector-codeigniter4)](https://packagist.org/packages/PHPDevsr/rector-codeigniter4) From c76b1d85166979858a4cbbb4f0ccb70755adc6b3 Mon Sep 17 00:00:00 2001 From: Denny Septian Panggabean Date: Mon, 1 Apr 2024 21:19:20 +0700 Subject: [PATCH 2/7] fix: php-cs-fixer --- .php-cs-fixer.dist.php | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 16db377..d943495 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -13,14 +13,16 @@ use CodeIgniter\CodingStandard\CodeIgniter4; use Nexus\CsConfig\Factory; +use Nexus\CsConfig\Fixer\Comment\NoCodeSeparatorCommentFixer; +use Nexus\CsConfig\FixerGenerator; use PhpCsFixer\Finder; $finder = Finder::create() ->files() ->in([ - __DIR__ . '/src/', - __DIR__ . '/tests/', - __DIR__ . '/config/', + __DIR__ . '/src', + __DIR__ . '/config', + __DIR__ . '/tests', ]) ->append([ __FILE__, @@ -33,12 +35,23 @@ ]; $options = [ - 'finder' => $finder, - 'cacheFile' => '.php-cs-fixer.cache', + 'finder' => $finder, + 'cacheFile' => '.php-cs-fixer.cache', ]; -return Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary( +$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary( 'CodeIgniter Rector', 'PHPDevsr', 'admin@phpdevsr.com' ); + +// @TODO: remove this check when support for PHP 7.4 is dropped +if (PHP_VERSION_ID >= 80000) { + $config + ->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer')) + ->setRules(array_merge($config->getRules(), [ + NoCodeSeparatorCommentFixer::name() => true, + ])); +} + +return $config; From 882da59ed030fb4ac70ad8983f053228d9fadc2e Mon Sep 17 00:00:00 2001 From: Denny Septian Panggabean Date: Mon, 1 Apr 2024 21:24:59 +0700 Subject: [PATCH 3/7] chore: analysis on github action --- .github/workflows/code_analysis.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code_analysis.yaml b/.github/workflows/code_analysis.yaml index 9aaa3a8..655842c 100644 --- a/.github/workflows/code_analysis.yaml +++ b/.github/workflows/code_analysis.yaml @@ -18,6 +18,7 @@ jobs: strategy: matrix: + php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3'] actions: - name: 'Composer Validate' @@ -35,14 +36,14 @@ jobs: name: 'PHPStan' run: composer phpstan - name: ${{ matrix.actions.name }} + name: ${{ matrix.actions.name }} - ${{ matrix.php-versions }} steps: - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: ${{ matrix.php-versions }} coverage: none - uses: ramsey/composer-install@v3 From 1c76658544f66d725785e4c23837888c86d6975e Mon Sep 17 00:00:00 2001 From: Denny Septian Panggabean Date: Mon, 1 Apr 2024 21:27:21 +0700 Subject: [PATCH 4/7] chore: composer update --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 554fe04..c236a32 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ "phpstan/extension-installer": "^1.3", "phpstan/phpstan": "^1.10.2", "phpstan/phpstan-strict-rules": "^1.5", - "phpunit/phpunit": "^10.5", + "phpunit/phpunit": "^9.6 || ^10.5", "codeigniter/phpstan-codeigniter": "^1.4", "symplify/rule-doc-generator": "^12.1", "codeigniter/coding-standard": "^1.7" From dc49a7d92bc03ec254fe14324188c978050107f9 Mon Sep 17 00:00:00 2001 From: Denny Septian Panggabean Date: Mon, 1 Apr 2024 21:30:54 +0700 Subject: [PATCH 5/7] chore: composer update --- .github/workflows/code_analysis.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_analysis.yaml b/.github/workflows/code_analysis.yaml index 655842c..89a8663 100644 --- a/.github/workflows/code_analysis.yaml +++ b/.github/workflows/code_analysis.yaml @@ -18,7 +18,7 @@ jobs: strategy: matrix: - php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3'] + php-versions: ['8.1', '8.2', '8.3'] actions: - name: 'Composer Validate' From 871d9fceea409a96cc9e4a5a1f82f9a0460d7f96 Mon Sep 17 00:00:00 2001 From: Denny Septian Panggabean Date: Mon, 1 Apr 2024 21:31:41 +0700 Subject: [PATCH 6/7] chore: composer update --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c236a32..554fe04 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ "phpstan/extension-installer": "^1.3", "phpstan/phpstan": "^1.10.2", "phpstan/phpstan-strict-rules": "^1.5", - "phpunit/phpunit": "^9.6 || ^10.5", + "phpunit/phpunit": "^10.5", "codeigniter/phpstan-codeigniter": "^1.4", "symplify/rule-doc-generator": "^12.1", "codeigniter/coding-standard": "^1.7" From 74c703272da3bc750ecafebd5e2864bfdb06da79 Mon Sep 17 00:00:00 2001 From: Denny Septian Panggabean Date: Mon, 1 Apr 2024 21:38:44 +0700 Subject: [PATCH 7/7] fix: remove temporary workflow php-cs-fixer --- .github/workflows/code_analysis.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/code_analysis.yaml b/.github/workflows/code_analysis.yaml index 89a8663..e7c840d 100644 --- a/.github/workflows/code_analysis.yaml +++ b/.github/workflows/code_analysis.yaml @@ -24,10 +24,6 @@ jobs: name: 'Composer Validate' run: composer validate - - - name: 'PHP-CS-Fixer' - run: composer lint - - name: 'Rector' run: composer rector