Skip to content

Commit 06a3007

Browse files
committed
ci: setup autofix
1 parent 8e8d0d5 commit 06a3007

2 files changed

Lines changed: 23 additions & 23 deletions

File tree

.github/workflows/autoformat.yml

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
name: Autoformat
1+
name: autofix.ci # needed to securely identify the workflow by the action
22

33
on:
4+
pull_request:
45
push:
6+
branches:
7+
- master
58

69
jobs:
710
composer-normalize:
811
runs-on: ubuntu-latest
912
steps:
1013
- uses: actions/checkout@v4
11-
with:
12-
ref: ${{ github.head_ref }}
1314

1415
- uses: shivammathur/setup-php@v2
1516
with:
@@ -21,17 +22,14 @@ jobs:
2122

2223
- run: composer normalize
2324

24-
- uses: stefanzweifel/git-auto-commit-action@v5
25+
- uses: autofix-ci/action@v1
2526
with:
26-
commit_message: Normalize composer.json
27+
commit-message: Apply composer normalize changes
2728

2829
docs:
2930
runs-on: ubuntu-latest
3031
steps:
3132
- uses: actions/checkout@v4
32-
with:
33-
ref: ${{ github.head_ref }}
34-
token: ${{ secrets.GA_PAT == '' && secrets.GA_PAT || secrets.GITHUB_TOKEN }}
3533

3634
- uses: shivammathur/setup-php@v2
3735
with:
@@ -43,23 +41,19 @@ jobs:
4341

4442
- run: composer docs
4543

46-
- uses: creyD/prettier_action@v4.3
44+
- uses: actionsx/prettier@v3
4745
with:
4846
prettier_options: --write --tab-width=2 *.md **/*.md
49-
commit_message: Prettify docs
47+
48+
- uses: autofix-ci/action@v1
49+
with:
50+
commit-message: Prettify docs
5051

5152
php-cs-fixer:
5253
runs-on: ubuntu-latest
5354

54-
permissions:
55-
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
56-
contents: write
57-
5855
steps:
5956
- uses: actions/checkout@v4
60-
with:
61-
ref: ${{ github.head_ref }}
62-
token: ${{ secrets.GA_PAT == '' && secrets.GA_PAT || secrets.GITHUB_TOKEN }}
6357

6458
- uses: shivammathur/setup-php@v2
6559
with:
@@ -71,6 +65,6 @@ jobs:
7165

7266
- run: vendor/bin/php-cs-fixer fix
7367

74-
- uses: stefanzweifel/git-auto-commit-action@v5
68+
- uses: autofix-ci/action@v1
7569
with:
76-
commit_message: Apply php-cs-fixer changes
70+
commit-message: Apply php-cs-fixer changes

src/Server/ServerConfig.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,15 @@ class ServerConfig
4747
*
4848
* @throws InvariantViolation
4949
*/
50-
public static function create(array $config = []): self
50+
public static function create(
51+
array $config = []): self
5152
{
5253
$instance = new static();
5354
foreach ($config as $key => $value) {
54-
switch ($key) {
55+
switch ($key ) {
5556
case 'schema':
57+
58+
5659
$instance->setSchema($value);
5760
break;
5861
case 'rootValue':
@@ -62,13 +65,16 @@ public static function create(array $config = []): self
6265
$instance->setContext($value);
6366
break;
6467
case 'fieldResolver':
65-
$instance->setFieldResolver($value);
68+
$instance->setFieldResolver($value
69+
);
6670
break;
6771
case 'validationRules':
6872
$instance->setValidationRules($value);
6973
break;
7074
case 'queryBatching':
71-
$instance->setQueryBatching($value);
75+
76+
$instance->setQueryBatching(
77+
$value);
7278
break;
7379
case 'debugFlag':
7480
$instance->setDebugFlag($value);

0 commit comments

Comments
 (0)