Skip to content

Commit 562ac79

Browse files
author
Jonathon Hill
committed
Switch to php-cs-fixer
1 parent bfad114 commit 562ac79

File tree

5 files changed

+1437
-1106
lines changed

5 files changed

+1437
-1106
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/vendor/
2+
/.php-cs-fixer.cache

.php-cs-fixer.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
$dirs = [
4+
__DIR__ . '/src',
5+
__DIR__ . '/tests',
6+
];
7+
8+
$rules = [
9+
'@PSR12' => true,
10+
'array_syntax' => ['syntax' => 'short'],
11+
'no_unused_imports' => true,
12+
'single_line_comment_style' => true,
13+
'single_line_comment_spacing' => true,
14+
'control_structure_braces' => true,
15+
'control_structure_continuation_position' => true,
16+
'no_useless_else' => true,
17+
'no_superfluous_elseif' => true,
18+
'simplified_if_return' => true,
19+
'single_quote' => true,
20+
];
21+
22+
$finder = PhpCsFixer\Finder::create()
23+
->in($dirs);
24+
25+
return (new PhpCsFixer\Config())
26+
->setRules($rules)
27+
->setFinder($finder);

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
lint:
2-
vendor/bin/phpstan --memory-limit=1G || true
3-
vendor/bin/phpcbf -q --standard=PSR12 src tests || true
4-
vendor/bin/phpcs --standard=PSR12 -s src tests
2+
vendor/bin/phpstan analyse -c phpstan.neon --memory-limit 1G
3+
vendor/bin/php-cs-fixer fix
54

65
test-behavior:
76
php -d memory_limit=4G vendor/bin/behat

composer.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,29 +40,29 @@
4040
},
4141
"require": {
4242
"php": "^7.4 || ^8.0",
43+
"dflydev/fig-cookies": "^3.0",
4344
"psr/simple-cache": "^1",
4445
"psr/http-message": "^1",
4546
"psr/http-server-handler": "^1",
46-
"psr/http-server-middleware": "^1",
47-
"dflydev/fig-cookies": "^3.0"
47+
"psr/http-server-middleware": "^1"
4848
},
4949
"require-dev": {
50-
"phpstan/phpstan": "dev-master",
51-
"phpunit/phpunit": "^9.5",
52-
"squizlabs/php_codesniffer": "*",
5350
"behat/behat": "^3.8",
54-
"kodus/file-cache": "^1.1",
55-
"matthiasmullie/scrapbook": "^1.4",
56-
"odan/cache": "^0.5.0",
57-
"league/flysystem": "^2.2",
5851
"bramus/monolog-colored-line-formatter": "^3.0",
5952
"compwright/swoole-psr7-compat": "^2.0",
53+
"friendsofphp/php-cs-fixer": "^3.11",
54+
"kodus/file-cache": "^1.1",
55+
"league/flysystem": "^2.2",
56+
"matthiasmullie/scrapbook": "^1.4",
6057
"middlewares/access-log": "^2.0",
6158
"monolog/monolog": "^2.3",
62-
"slim/psr7": "^1.4",
63-
"slim/slim": "^4.8",
59+
"odan/cache": "^0.5.0",
6460
"php-di/php-di": "^6.3",
65-
"psr/log": "^1.1"
61+
"phpstan/phpstan": "^1.8",
62+
"phpunit/phpunit": "^9.5",
63+
"psr/log": "^1.1",
64+
"slim/psr7": "^1.4",
65+
"slim/slim": "^4.8"
6666
},
6767
"autoload": {
6868
"psr-4": {

0 commit comments

Comments
 (0)