Skip to content

Commit 2f77717

Browse files
authored
Update package name & refactor code style configuration (#275)
1 parent 9402bfa commit 2f77717

File tree

11 files changed

+536
-328
lines changed

11 files changed

+536
-328
lines changed

.github/workflows/phpunit.yml

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,45 +8,26 @@ on:
88

99
jobs:
1010
test:
11-
name: Test & Upload coverage.xml to Codecov
11+
name: Run tests (PHP ${{ matrix.php }})
1212
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php: [ '8.3', '8.4' ]
1317

1418
steps:
1519
- name: Checkout Code
1620
uses: actions/checkout@v4
1721

18-
- name: Setup PHP 8.3
22+
- name: Setup PHP
1923
uses: shivammathur/setup-php@v2
2024
with:
21-
php-version: 8.3
25+
php-version: ${{ matrix.php }}
2226
extensions: mbstring, pdo, sqlite, pdo_sqlite
2327
ini-values: max_execution_time=180
2428

25-
- name: Install PHP extensions
26-
run: |
27-
sudo apt update
28-
sudo apt-get install -y php-phpdbg
29-
3029
- name: Install Composer Dependencies
3130
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
3231

3332
- name: Run tests via PHPUnit
34-
env:
35-
XDEBUG_MODE: coverage
36-
run: |
37-
vendor/bin/phpunit --coverage-clover=coverage.xml
38-
cat ./coverage.xml
39-
40-
- name: Show coverage.xml
41-
run: cat ./coverage.xml
42-
43-
- name: Upload coverage.xml to Codecov
44-
uses: codecov/codecov-action@v5
45-
with:
46-
token: ${{ secrets.CODECOV_TOKEN }}
47-
files: ./coverage.xml
48-
fail_ci_if_error: true
49-
flags: unittests
50-
name: codecov-umbrella
51-
verbose: true
52-
env_vars: PHP
33+
run: vendor/bin/phpunit

.php-cs-fixer.dist.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
declare(strict_types=1);
44

5-
use Gomzyakov\CS\Finder;
6-
use Gomzyakov\CS\Config;
5+
use Gomzyakov\CodeStyleFinder;
6+
use Gomzyakov\CodeStyleConfig;
77

88
// Routes for analysis with `php-cs-fixer`
99
$routes = ['./src', './tests'];
1010

11-
return Config::createWithFinder(Finder::createWithRoutes($routes));
11+
return CodeStyleConfig::createWithFinder(CodeStyleFinder::createWithRoutes($routes));

README.md

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
> [!CAUTION]
2-
> This package is abandoned and no longer maintained. The author suggests using the [gomzyakov/pint](https://github.com/gomzyakov/pint) package instead.
3-
41
# Code-style configuration for `php-cs-fixer`
52

6-
[![packagist](https://img.shields.io/packagist/v/gomzyakov/php-cs-fixer-config.svg)](https://packagist.org/packages/gomzyakov/php-cs-fixer-config)
7-
[![downloads_count](https://img.shields.io/packagist/dt/gomzyakov/php-cs-fixer-config.svg)](https://packagist.org/packages/gomzyakov/php-cs-fixer-config)
8-
[![license](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/gomzyakov/php-cs-fixer-config/blob/development/LICENSE)
9-
[![codecov](https://codecov.io/gh/gomzyakov/php-cs-fixer-config/branch/main/graph/badge.svg?token=4CYTVMVUYV)](https://codecov.io/gh/gomzyakov/php-cs-fixer-config)
3+
[![packagist](https://img.shields.io/packagist/v/gomzyakov/code-style.svg)](https://packagist.org/packages/gomzyakov/code-style)
4+
[![downloads_count](https://img.shields.io/packagist/dt/gomzyakov/code-style.svg)](https://packagist.org/packages/gomzyakov/code-style)
5+
[![license](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/gomzyakov/code-style/blob/development/LICENSE)
6+
[![codecov](https://codecov.io/gh/gomzyakov/code-style/branch/main/graph/badge.svg?token=4CYTVMVUYV)](https://codecov.io/gh/gomzyakov/code-style)
107

118
This package allows sharing identical [php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) formatting rules across all of your projects without copy-and-pasting configuration files.
129

@@ -17,7 +14,7 @@ This package allows sharing identical [php-cs-fixer](https://github.com/PHP-CS-F
1714
Install [`friendsofphp/php-cs-fixer`](https://github.com/FriendsOfPHP/PHP-CS-Fixer) & this package via Composer:
1815

1916
```sh
20-
composer require --dev friendsofphp/php-cs-fixer gomzyakov/php-cs-fixer-config
17+
composer require --dev friendsofphp/php-cs-fixer gomzyakov/code-style
2118
```
2219

2320
### Step 2 of 3
@@ -27,13 +24,13 @@ Then create file `.php-cs-fixer.dist.php` at the root of your project with follo
2724
```php
2825
<?php
2926

30-
use Gomzyakov\CS\Finder;
31-
use Gomzyakov\CS\Config;
27+
use Gomzyakov\CodeStyleFinder;
28+
use Gomzyakov\CodeStyleConfig;
3229

3330
// Routes for analysis with `php-cs-fixer`
3431
$routes = ['./src', './tests'];
3532

36-
return Config::createWithFinder(Finder::createWithRoutes($routes));
33+
return CodeStyleConfig::createWithFinder(CodeStyleFinder::createWithRoutes($routes));
3734
```
3835

3936
Change the value of `$routes` depending on where your project's source code is.
@@ -54,28 +51,28 @@ And then completely fix them all with:
5451

5552
## Configuration
5653

57-
You must pass a set of routes to the `Finder::createWithRoutes()` call. For example, for [Laravel](https://laravel.com) projects, this would be:
54+
You must pass a set of routes to the `CodeStyleFinder::createWithRoutes()` call. For example, for [Laravel](https://laravel.com) projects, this would be:
5855

5956
```php
60-
Finder::createWithRoutes(['./app', './config', './database', './routes', './tests'])
57+
CodeStyleFinder::createWithRoutes(['./app', './config', './database', './routes', './tests'])
6158
```
6259

63-
Also, you can pass a custom set of rules to the `Config::createWithFinder()` call:
60+
Also, you can pass a custom set of rules to the `CodeStyleConfig::createWithFinder()` call:
6461

6562
```php
66-
Config::createWithFinder($finder, [
63+
CodeStyleConfig::createWithFinder($finder, [
6764
'@PHP81Migration' => true,
6865
'array_indentation' => false
6966
])
7067
```
7168

7269
## Support
7370

74-
If you find any package errors, please, [make an issue](https://github.com/gomzyakov/php-cs-fixer-config/issues) in current repository.
71+
If you find any package errors, please, [make an issue](https://github.com/gomzyakov/code-style/issues) in current repository.
7572

7673
## License
7774

78-
This is open-sourced software licensed under the [MIT License](https://github.com/gomzyakov/php-cs-fixer-config/blob/main/LICENSE).
75+
This is open-sourced software licensed under the [MIT License](https://github.com/gomzyakov/code-style/blob/main/LICENSE).
7976

8077
## Special thanks
8178

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "gomzyakov/php-cs-fixer-config",
2+
"name": "gomzyakov/code-style",
33
"description": "Code style configuration for `php-cs-fixer` based on PSR-12.",
44
"type": "package",
55
"license": "MIT",
@@ -8,7 +8,7 @@
88
"php-cs-fixer",
99
"code-style"
1010
],
11-
"homepage": "https://github.com/gomzyakov/php-cs-fixer-config",
11+
"homepage": "https://github.com/gomzyakov/code-style",
1212
"authors": [
1313
{
1414
"name": "Alexander Gomzyakov",
@@ -27,7 +27,7 @@
2727
},
2828
"autoload": {
2929
"psr-4": {
30-
"Gomzyakov\\CS\\": "src/"
30+
"Gomzyakov\\": "src/"
3131
}
3232
},
3333
"autoload-dev": {
@@ -36,7 +36,7 @@
3636
}
3737
},
3838
"scripts": {
39-
"cs-fix": "@php ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php",
39+
"fix": "@php ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php",
4040
"cs-check": "@php ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run",
4141
"phpstan": "@php ./vendor/bin/phpstan analyze -c ./phpstan.neon.dist --no-progress --ansi",
4242
"phpunit": "@php ./vendor/bin/phpunit ./tests --no-coverage --color=always",

0 commit comments

Comments
 (0)