Skip to content

Commit

Permalink
upgrade to PHP-CS-Fixer 3
Browse files Browse the repository at this point in the history
  • Loading branch information
othillo committed Jun 3, 2021
1 parent a52a689 commit bf5d2a5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
$finder = PhpCsFixer\Finder::create()
->in(__DIR__);

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setRules([
'@Symfony' => true,
'declare_strict_types' => true,
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ dependencies:

.PHONY: php-cs-fixer
php-cs-fixer:
vendor/bin/php-cs-fixer fix --no-interaction --allow-risky=yes --diff --verbose .php_cs.dist
vendor/bin/php-cs-fixer fix --no-interaction --allow-risky=yes --diff --verbose .php-cs-fixer.dist.php

.PHONY: php-cs-fixer-ci
php-cs-fixer-ci:
PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --dry-run --no-interaction --allow-risky=yes --diff --verbose .php_cs.dist
PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --dry-run --no-interaction --allow-risky=yes --diff --verbose .php-cs-fixer.dist.php

# Based on https://suva.sh/posts/well-documented-makefiles/
help: ## Display this help
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ $ composer require --dev broadway/coding-standard

## PHP CS fixer

1. create a `.php_cs` file referencing the `.php_cs.dist` template:
1. create a `.php-cs-fixer.php` file referencing the `.php-cs-fixer.dist.php` template:

```php
# .php_cs
# .php-cs-fixer.php

<?php

$config = require 'vendor/broadway/coding-standard/.php_cs.dist';
$config = require 'vendor/broadway/coding-standard/.php-cs-fixer.dist.php';

$config->setFinder(
\PhpCsFixer\Finder::create()
Expand Down Expand Up @@ -49,6 +49,6 @@ cp vendor/broadway/coding-standard/.docheader.dist ./.docheader
# Usage

```
$ vendor/bin/php-cs-fixer fix --config=".php_cs" --allow-risky=yes --diff --verbose
$ vendor/bin/php-cs-fixer fix --allow-risky=yes --diff --verbose
$ vendor/bin/docheader check {src,test}
```
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
}
],
"require": {
"friendsofphp/php-cs-fixer": "^2.17",
"friendsofphp/php-cs-fixer": "^3.0",
"malukenho/docheader": "^0.1.7",
"php": ">=7.2"
"php": ">=7.3"
},
"extra": {
"branch-alias": {
Expand Down

0 comments on commit bf5d2a5

Please sign in to comment.