Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Commit af72c05

Browse files
committed
Add php-cs-fixer
1 parent 0420474 commit af72c05

35 files changed

+2062
-181
lines changed

.github/workflows/php.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,4 @@ jobs:
3838
run: composer install --prefer-dist --no-progress --no-suggest
3939

4040
- name: Run test suite
41-
run: composer run-script test
42-
43-
- name: Run static analysis
44-
run: composer run-script stan
41+
run: composer run-script qa

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
vendor
22
build
3+
.php-cs-fixer.cache

.php-cs-fixer.dist.php

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->in(['src', 'tests'])
5+
;
6+
$config = new PhpCsFixer\Config();
7+
$config
8+
->setFinder($finder)
9+
;
10+
11+
return $config;

composer.json

+53-49
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,55 @@
11
{
2-
"name": "usox/json-schema-api",
3-
"description": "Json schema powered api creation for php",
4-
"type": "library",
5-
"license": "MIT",
6-
"authors": [
7-
{
8-
"name": "Daniel Jakob",
9-
"email": "github@usox.org"
10-
}
11-
],
12-
"require": {
13-
"php": "^7.4 || ^8.0",
14-
"ext-json": "*",
15-
"justinrainbow/json-schema": "^5.2",
16-
"php-http/discovery": "^1.13",
17-
"psr/http-factory": "^1.0",
18-
"psr/http-message": "^1.0",
19-
"psr/http-server-middleware": "^1.0",
20-
"psr/log": "^1.1",
21-
"ramsey/uuid": "^4.1",
22-
"shrikeh/teapot": "^2.3"
23-
},
24-
"autoload": {
25-
"psr-4": {
26-
"Usox\\JsonSchemaApi\\": "src/"
27-
}
28-
},
29-
"autoload-dev": {
30-
"psr-4": {
31-
"Usox\\JsonSchemaApi\\": "tests/"
32-
}
33-
},
34-
"require-dev": {
35-
"laminas/laminas-diactoros": "^2.4",
36-
"mikey179/vfsstream": "^1.6",
37-
"mockery/mockery": "^1.4",
38-
"phpstan/phpstan": "^0.12.80",
39-
"phpstan/phpstan-mockery": "^0.12.12",
40-
"phpstan/phpstan-strict-rules": "^0.12.9",
41-
"phpunit/phpunit": "^9.5"
42-
},
43-
"config": {
44-
"sort-packages": true
45-
},
46-
"scripts": {
47-
"test": "./vendor/bin/phpunit tests",
48-
"stan": "./vendor/bin/phpstan analyse",
49-
"coverage": "./vendor/bin/phpunit --warm-coverage-cache tests && XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-html build/coverage tests"
50-
}
2+
"name": "usox/json-schema-api",
3+
"description": "Json schema powered api creation for php",
4+
"type": "library",
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "Daniel Jakob",
9+
"email": "github@usox.org"
10+
}
11+
],
12+
"require": {
13+
"php": "^7.4 || ^8.0",
14+
"ext-json": "*",
15+
"justinrainbow/json-schema": "^5.2",
16+
"php-http/discovery": "^1.13",
17+
"psr/http-factory": "^1.0",
18+
"psr/http-message": "^1.0",
19+
"psr/http-server-middleware": "^1.0",
20+
"psr/log": "^1.1",
21+
"ramsey/uuid": "^4.1",
22+
"shrikeh/teapot": "^2.3"
23+
},
24+
"autoload": {
25+
"psr-4": {
26+
"Usox\\JsonSchemaApi\\": "src/"
27+
}
28+
},
29+
"autoload-dev": {
30+
"psr-4": {
31+
"Usox\\JsonSchemaApi\\": "tests/"
32+
}
33+
},
34+
"require-dev": {
35+
"friendsofphp/php-cs-fixer": "^3.0",
36+
"laminas/laminas-diactoros": "^2.4",
37+
"mikey179/vfsstream": "^1.6",
38+
"mockery/mockery": "^1.4",
39+
"phpstan/phpstan": "^0.12.80",
40+
"phpstan/phpstan-mockery": "^0.12.12",
41+
"phpstan/phpstan-strict-rules": "^0.12.9",
42+
"phpunit/phpunit": "^9.5"
43+
},
44+
"config": {
45+
"sort-packages": true
46+
},
47+
"scripts": {
48+
"qa": "@composer check-cs && @composer stan && @composer stan",
49+
"check-cs": "./vendor/bin/php-cs-fixer fix --dry-run",
50+
"fix-cs": "./vendor/bin/php-cs-fixer fix",
51+
"test": "./vendor/bin/phpunit tests",
52+
"stan": "./vendor/bin/phpstan analyse",
53+
"coverage": "./vendor/bin/phpunit --warm-coverage-cache tests && XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-html build/coverage tests"
54+
}
5155
}

0 commit comments

Comments
 (0)