Skip to content

Commit edf52c3

Browse files
Add php-cs-fixer as a development requirement
1 parent 4bc6901 commit edf52c3

File tree

5 files changed

+1206
-43
lines changed

5 files changed

+1206
-43
lines changed

.github/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Behat API Extension has both [Behat](http://docs.behat.org/) and [PHPUnit](https
88

99
The Behat tests requires a web server hosting the `features/bootstrap/index.php` script. A quick and easy alternative is to use PHPs built in web server:
1010

11-
php -S localhost:8080 -t ./features/bootstrap > server.log 2>&1
11+
php -S localhost:8080 -t ./features/bootstrap > build/httpd.log 2>&1
1212

1313
After this has been started you can execute the test suites by running:
1414

@@ -51,4 +51,4 @@ Please also specify which commit that resolves the bug by adding `Resolves #<iss
5151

5252
## Coding standards
5353

54-
This library follows the [imbo/imbo-coding-standard](https://github.com/imbo/imbo-coding-standard) coding standard, and runs [php-cs-fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) as a step in the CI workflow.
54+
This library follows the [imbo/imbo-coding-standard](https://github.com/imbo/imbo-coding-standard) coding standard, and runs [php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) as a step in the CI workflow.

.github/workflows/ci.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,25 @@ jobs:
55
runs-on: ubuntu-latest
66
strategy:
77
matrix:
8-
php: ['8.3', '8.4']
8+
php: ["8.3", "8.4"]
99
name: Validate and test on PHP ${{ matrix.php }}
1010
steps:
11-
- uses: actions/checkout@v4
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
1213

1314
- name: Setup PHP
1415
uses: shivammathur/setup-php@v2
1516
with:
1617
php-version: ${{ matrix.php }}
17-
tools: php-cs-fixer
1818

19-
- name: Debug PHP installation
20-
run: |
21-
php -v
22-
php -i
23-
php -m
19+
- name: PHP version
20+
run: php -v
21+
22+
- name: PHP info
23+
run: php -i
24+
25+
- name: PHP modules
26+
run: php -m
2427

2528
- name: Validate composer files
2629
run: composer validate --strict
@@ -34,9 +37,9 @@ jobs:
3437
uses: actions/cache@v4
3538
with:
3639
path: ${{ steps.composer-cache-dir.outputs.dir }}
37-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
40+
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
3841
restore-keys: |
39-
${{ runner.os }}-composer-
42+
${{ runner.os }}-php-${{ matrix.php }}-composer-
4043
4144
- name: Install dependencies
4245
run: composer install
@@ -54,7 +57,7 @@ jobs:
5457
run: vendor/bin/phpstan
5558

5659
- name: Check coding standard
57-
run: php-cs-fixer fix --dry-run --diff
60+
run: vendor/bin/php-cs-fixer fix --dry-run --diff
5861
env:
5962
PHP_CS_FIXER_IGNORE_ENV: 1
6063

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
vendor
22
build
3-
server.log
43
phpunit.xml
54
docs/_build
65
.idea

composer.json

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,26 @@
22
"name": "imbo/behat-api-extension",
33
"type": "library",
44
"description": "API extension for Behat",
5-
"keywords": ["behat", "testing", "api", "REST", "http"],
5+
"keywords": [
6+
"behat",
7+
"testing",
8+
"api",
9+
"REST",
10+
"http"
11+
],
612
"homepage": "https://github.com/imbo/behat-api-extension",
713
"license": "MIT",
8-
"authors": [{
9-
"name": "Christer Edvartsen",
10-
"email": "[email protected]",
11-
"homepage": "https://github.com/christeredvartsen"
12-
}, {
13-
"name": "Contributors",
14-
"homepage": "https://github.com/imbo/behat-api-extension/graphs/contributors"
15-
}],
14+
"authors": [
15+
{
16+
"name": "Christer Edvartsen",
17+
"email": "[email protected]",
18+
"homepage": "https://github.com/christeredvartsen"
19+
},
20+
{
21+
"name": "Contributors",
22+
"homepage": "https://github.com/imbo/behat-api-extension/graphs/contributors"
23+
}
24+
],
1625
"support": {
1726
"source": "https://github.com/imbo/behat-api-extension",
1827
"docs": "http://behat-api-extension.readthedocs.io/",
@@ -27,6 +36,7 @@
2736
"guzzlehttp/guzzle": "^7.3"
2837
},
2938
"require-dev": {
39+
"friendsofphp/php-cs-fixer": "^3.70",
3040
"imbo/imbo-coding-standard": "^2.0",
3141
"phpstan/extension-installer": "^1.4",
3242
"phpstan/phpstan": "^2.1",
@@ -63,8 +73,8 @@
6373
"phpunit:coverage": "vendor/bin/phpunit --coverage-html build/coverage",
6474
"behat": "vendor/bin/behat --strict",
6575
"sa": "vendor/bin/phpstan",
66-
"cs": "php-cs-fixer fix --dry-run --diff",
67-
"dev": "php -S localhost:8080 -t ./features/bootstrap > server.log 2>&1",
76+
"cs": "vendor/bin/php-cs-fixer fix --dry-run --diff",
77+
"dev": "php -S localhost:8080 -t ./features/bootstrap > build/httpd.log 2>&1",
6878
"docs": "cd docs; make html"
6979
},
7080
"config": {

0 commit comments

Comments
 (0)