Skip to content

Commit 75f0085

Browse files
Update php.yml
Signed-off-by: Dominik <163560221+Dominik-developer@users.noreply.github.com>
1 parent fffed50 commit 75f0085

File tree

1 file changed

+10
-19
lines changed

1 file changed

+10
-19
lines changed

.github/workflows/php.yml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,42 +13,33 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
# 1. Fetch code from the repository
1716
- name: Checkout code
1817
uses: actions/checkout@v3
1918

20-
# 2. Set up PHP
2119
- name: Setup PHP
2220
uses: shivammathur/setup-php@v2
2321
with:
2422
php-version: '8.1'
2523

26-
# 3. Check PHP syntax in all files
27-
- name: Lint PHP files
24+
- name: Install Composer
2825
run: |
29-
find . -name "*.php" -not -path "./vendor/*" -exec php -l {} \;
26+
curl -sS https://getcomposer.org/installer | php
27+
mv composer.phar /usr/local/bin/composer
28+
29+
- name: Lint PHP files
30+
run: find . -name "*.php" -not -path "./vendor/*" -exec php -l {} \;
3031

31-
# 4. Install PHPStan (Static Analysis Tool)
3232
- name: Install PHPStan
33-
run: |
34-
curl -sS https://getcomposer.org/installer | php
35-
php composer.phar require --dev phpstan/phpstan
33+
run: composer require --dev phpstan/phpstan
3634

37-
# 5. Run PHPStan to analyze code quality
3835
- name: Run PHPStan
39-
run: |
40-
vendor/bin/phpstan analyse --level=max
36+
run: vendor/bin/phpstan analyse --level=max admin public
4137

42-
# 6. Install PHP CS Fixer (Code Style Checker)
4338
- name: Install PHP CS Fixer
44-
run: |
45-
curl -sS https://getcomposer.org/installer | php
46-
php composer.phar require --dev friendsofphp/php-cs-fixer
39+
run: composer require --dev friendsofphp/php-cs-fixer
4740

48-
# 7. Run PHP CS Fixer to check code style
4941
- name: Check code style
50-
run: |
51-
vendor/bin/php-cs-fixer fix --dry-run --diff
42+
run: vendor/bin/php-cs-fixer fix --dry-run --diff
5243

5344
# 8. (Optional) Install Composer dependencies - useful if you add dependencies in the future
5445
# - name: Install dependencies

0 commit comments

Comments
 (0)