Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ddevsr committed Apr 2, 2024
2 parents 823c14b + 74c7032 commit da20b6d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/code_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@ jobs:

strategy:
matrix:
php-versions: ['8.1', '8.2', '8.3']
actions:
-
name: 'Composer Validate'
run: composer validate

-
name: 'PHP-CS-Fixer'
run: composer lint

-
name: 'Rector'
run: composer rector
Expand All @@ -35,14 +32,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
Expand Down
25 changes: 19 additions & 6 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -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__,
Expand All @@ -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',
'[email protected]'
);

// @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;
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit da20b6d

Please sign in to comment.