Skip to content

Commit 432a8c9

Browse files
authored
Replace StyleCI with PHP CS Fixer (#175)
1 parent 2124963 commit 432a8c9

27 files changed

+496
-519
lines changed

.github/workflows/rector-cs.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Rector + PHP CS Fixer
2+
3+
on:
4+
pull_request_target:
5+
paths:
6+
- 'src/**'
7+
- 'tests/**'
8+
- '.github/workflows/rector-cs.yml'
9+
- 'composer.json'
10+
- 'rector.php'
11+
- '.php-cs-fixer.dist.php'
12+
13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
rector:
22+
uses: yiisoft/actions/.github/workflows/rector-cs.yml@master
23+
secrets:
24+
token: ${{ secrets.YIISOFT_GITHUB_TOKEN }}
25+
with:
26+
repository: ${{ github.event.pull_request.head.repo.full_name }}
27+
php: '8.1'

.github/workflows/rector.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,7 @@ composer.phar
2626
/phpunit.phar
2727
/phpunit.xml
2828
/.phpunit.cache
29+
30+
# PHP CS Fixer
31+
/.php-cs-fixer.cache
32+
/.php-cs-fixer.php

.php-cs-fixer.dist.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use PhpCsFixer\Config;
6+
use PhpCsFixer\Finder;
7+
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
8+
9+
$finder = (new Finder())->in([
10+
__DIR__ . '/src',
11+
__DIR__ . '/tests',
12+
]);
13+
14+
return (new Config())
15+
->setRiskyAllowed(true)
16+
->setParallelConfig(ParallelConfigFactory::detect())
17+
->setRules([
18+
'@PER-CS3.0' => true,
19+
'no_unused_imports' => true,
20+
'ordered_class_elements' => true,
21+
'class_attributes_separation' => ['elements' => ['method' => 'one']],
22+
'declare_strict_types' => true,
23+
'native_function_invocation' => true,
24+
'native_constant_invocation' => true,
25+
'fully_qualified_strict_types' => [
26+
'import_symbols' => true
27+
],
28+
'global_namespace_import' => [
29+
'import_classes' => true,
30+
'import_constants' => true,
31+
'import_functions' => true,
32+
],
33+
])
34+
->setFinder($finder);

.styleci.yml

Lines changed: 0 additions & 85 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## 3.2.2 under development
44

5-
- no changes in this release.
5+
- Enh #175: Explicitly import functions and constants in "use" section (@mspirkov)
66

77
## 3.2.1 November 26, 2025
88

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"yiisoft/strings": "^2.6"
3333
},
3434
"require-dev": {
35+
"friendsofphp/php-cs-fixer": "^3.92.5",
3536
"bamarni/composer-bin-plugin": "^1.8.2",
3637
"phpunit/phpunit": "^10.5.48",
3738
"rector/rector": "^2.1.2",

0 commit comments

Comments
 (0)