Skip to content

Commit 303be57

Browse files
authored
Merge pull request #9 from nagels-tech/setup-phpcs-fixer-1954016256
Applied Php-cs-fixer
2 parents 8d3af70 + 37ceb8c commit 303be57

20 files changed

+463
-1176
lines changed

.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Database Configuration
2+
NEO4J_ADDRESS=https://6f72daa1.databases.neo4j.io/
3+
NEO4J_USERNAME=neo4j
4+
NEO4J_PASSWORD=O9lWmptqBgxBOz8NVcTJjgs3cHPyYmsy63ui6Spmw1d0

.github/workflows/cs-fixer.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: PHP CS Fixer
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '**/*.php'
9+
pull_request:
10+
paths:
11+
- '**/*.php'
12+
13+
jobs:
14+
php-cs-fixer:
15+
name: PHP CS Fixer
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v3
21+
22+
- name: Set up PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: 8.2
26+
tools: composer
27+
28+
- name: Install dependencies
29+
run: composer install --no-progress --prefer-dist
30+
31+
- name: Run PHP CS Fixer
32+
run: vendor/bin/php-cs-fixer fix --dry-run --diff --allow-risky=yes

.github/workflows/ci.yml renamed to .github/workflows/test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ jobs:
3535
- name: Install dependencies
3636
run: composer install --no-progress --prefer-dist
3737

38-
39-
4038
- name: Run Tests without phpunit.xml
39+
env:
40+
NEO4J_ADDRESS: ${{ secrets.NEO4J_ADDRESS }}
41+
NEO4J_USERNAME: ${{ secrets.NEO4J_USERNAME }}
42+
NEO4J_PASSWORD: ${{ secrets.NEO4J_PASSWORD }}
4143
run: vendor/bin/phpunit --configuration phpunit.dist.xml

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1+
#IDE
12
.idea/
3+
4+
#COMPOSER
25
vendor
6+
7+
#PHPUNIT
38
phpunit.xml
49
test
510
.phpunit.result.cache
11+
12+
#PHP-CS-FIXER
13+
.php-cs-fixer.php
14+
.php-cs-fixer.cache

.php-cs-fixer.dist.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php declare(strict_types=1);
2+
3+
use PhpCsFixer\Config;
4+
use PhpCsFixer\Finder;
5+
6+
return (new Config())
7+
->setRules([
8+
'@PSR12' => true,
9+
])
10+
->setFinder(
11+
Finder::create()
12+
->in(__DIR__)
13+
->exclude([
14+
'vendor',
15+
])
16+
);

composer.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@
88
"ext-json": "*",
99
"php": "^8.1"
1010
},
11-
1211
"require-dev": {
13-
"phpunit/phpunit": "^10.0",
14-
"vimeo/psalm": "^5.26",
15-
"friendsofphp/php-cs-fixer": "^3.67"
12+
"phpunit/phpunit": "^11.0",
13+
"friendsofphp/php-cs-fixer": "^3.68"
1614
},
1715
"autoload": {
1816
"psr-4": {
@@ -30,10 +28,15 @@
3028
"email": "[email protected]"
3129
}
3230
],
33-
"symfony/finder": "^7.2",
3431
"config": {
3532
"allow-plugins": {
3633
"php-http/discovery": true
3734
}
35+
},
36+
37+
"scripts": {
38+
"cs": "vendor/bin/php-cs-fixer fix --dry-run --diff --allow-risky=yes",
39+
"cs:fix": "vendor/bin/php-cs-fixer fix --allow-risky=yes"
3840
}
39-
}
41+
42+
}

0 commit comments

Comments
 (0)