Skip to content

Commit 77aae67

Browse files
committed
ci: setup autofix
1 parent 8e8d0d5 commit 77aae67

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

.github/workflows/autoformat.yml

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

33
on:
44
push:
@@ -52,14 +52,10 @@ jobs:
5252
runs-on: ubuntu-latest
5353

5454
permissions:
55-
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
56-
contents: write
55+
contents: read
5756

5857
steps:
5958
- uses: actions/checkout@v4
60-
with:
61-
ref: ${{ github.head_ref }}
62-
token: ${{ secrets.GA_PAT == '' && secrets.GA_PAT || secrets.GITHUB_TOKEN }}
6359

6460
- uses: shivammathur/setup-php@v2
6561
with:
@@ -71,6 +67,6 @@ jobs:
7167

7268
- run: vendor/bin/php-cs-fixer fix
7369

74-
- uses: stefanzweifel/git-auto-commit-action@v5
70+
- uses: autofix-ci/action@v1
7571
with:
76-
commit_message: Apply php-cs-fixer changes
72+
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)