Skip to content

Commit 78eb04a

Browse files
authored
Merge pull request #2
Update diagnostics.yml and phpcq configuration
2 parents a0b7fbe + 8c19573 commit 78eb04a

File tree

4 files changed

+46
-28
lines changed

4 files changed

+46
-28
lines changed

.github/workflows/diagnostics.yml

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,41 @@
11
name: Code Quality Diagnostics
22

3-
env:
4-
PHPCQ_DIRECTORY: ./phpcq-runner
5-
6-
on: [pull_request, push]
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
78

89
jobs:
910
build:
1011
runs-on: ubuntu-latest
1112

13+
name: PHP ${{ matrix.php }}
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- php: 7.4
20+
output: '-o github-action -o default'
21+
phpcq_install: 'install'
22+
- php: 8.0
23+
output: '-o default'
24+
phpcq_install: 'update'
25+
1226
steps:
1327
- name: Pull source
1428
uses: actions/checkout@v2
1529

1630
- name: Setup PHP with PECL extension
1731
uses: shivammathur/setup-php@v2
1832
with:
19-
php-version: '7.4'
20-
coverage: xdebug2
33+
php-version: ${{ matrix.php }}
2134

2235
- name: Cache composer cache directory
2336
uses: actions/cache@v1
2437
env:
25-
cache-name: composer-cache-dir
38+
cache-name: composer-cache-dir-${{ matrix.php }}
2639
with:
2740
path: ~/.cache/composer
2841
key: ${{ runner.os }}-build-${{ env.cache-name }}
@@ -33,25 +46,32 @@ jobs:
3346
- name: Cache vendor directory
3447
uses: actions/cache@v1
3548
env:
36-
cache-name: vendor
49+
cache-name: vendor-${{ matrix.php }}
3750
with:
3851
path: vendor
3952
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
4053
restore-keys: |
4154
${{ runner.os }}-build-${{ env.cache-name }}-
4255
4356
- name: Install phpcq toolchain
44-
run: ./vendor/bin/phpcq install -v
57+
run: ./vendor/bin/phpcq ${{ matrix.phpcq_install }} -v
4558

4659
- name: Cache phpcq directory
4760
uses: actions/cache@v1
4861
env:
49-
cache-name: phpcq
62+
cache-name: phpcq-${{ matrix.php }}
5063
with:
5164
path: .phpcq
5265
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/.phpcq.lock') }}
5366
restore-keys: |
5467
${{ runner.os }}-build-${{ env.cache-name }}-
5568
5669
- name: Run tests
57-
run: ./vendor/bin/phpcq run -o github-action -o default
70+
run: ./vendor/bin/phpcq run -v ${{ matrix.output }}
71+
72+
- name: Upload build directory to artifact
73+
uses: actions/upload-artifact@v2
74+
if: ${{ success() }} || ${{ failure() }}
75+
with:
76+
name: phpcq-builds-php-${{ matrix.php }}
77+
path: .phpcq/build/

.phpcq.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"plugins":{"phpunit":{"api-version":"1.0.0","version":"1.0.0","type":"php-file","url":"https://phpcq.github.io/repository/phpunit-1.0.0.php","signature":null,"requirements":{"tool":{"phpunit":"^6.0 || ^7.0 || ^8.0 || ^9.0"}},"checksum":{"type":"sha-512","value":"e93fe080534e1de79557687ccd9b6be11e9c7d08884159eb843e8e9293fa3b8008bd296fff32ee72092b1e80393764ee340d53b44fefea4ae619c8d4cda611bf"},"tools":{"phpunit":{"version":"9.5.8","url":"https://phar.phpunit.de/phpunit-9.5.8.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*","ext-json":"*","ext-libxml":"*","ext-mbstring":"*","ext-xml":"*","ext-xmlwriter":"*"}},"checksum":{"type":"sha-256","value":"11f27cf3f9522241fe234e9bf5813667207a074ac92089aac26d502ffc5e9517"},"signature":"https://phar.phpunit.de/phpunit-9.5.8.phar.asc"}}},"psalm":{"api-version":"1.0.0","version":"1.0.0","type":"php-file","url":"https://phpcq.github.io/repository/psalm-1.0.0.php","signature":null,"requirements":{"tool":{"psalm":"^3.0 || ^4.0"}},"checksum":{"type":"sha-512","value":"0d58090eb3dc92946ec16262c4cdd957d07aa1a28cd1345a42c998e007b4d7526481a1347ff7f281fb36116d0b83b686b08b22dad2a2c34dec5cc3b66fb75759"},"tools":{"psalm":{"version":"4.9.3","url":"https://github.com/vimeo/psalm/releases/download/4.9.3/psalm.phar","requirements":{"php":{"php":"^7.1|^8","ext-SimpleXML":"*","ext-dom":"*","ext-json":"*","ext-libxml":"*","ext-tokenizer":"*","ext-mbstring":"*"}},"checksum":null,"signature":"https://github.com/vimeo/psalm/releases/download/4.9.3/psalm.phar.asc"}}},"composer-require-checker":{"api-version":"1.0.0","version":"1.0.0","type":"php-file","url":"https://phpcq.github.io/repository/composer-require-checker-1.0.0.php","signature":null,"requirements":{"tool":{"composer-require-checker":"^3.0 | ^2.0"}},"checksum":{"type":"sha-512","value":"39507e83aee0cad92c00dcb4c755bd39c1a9157bbd919e2092aaf81b02bc5a84693335d8f3a73427e66c08c12ff81e35ed4be2d05ff33f2d368229c220a1307a"},"tools":{"composer-require-checker":{"version":"3.3.0","url":"https://github.com/maglnet/ComposerRequireChecker/releases/download/3.3.0/composer-require-checker.phar","requirements":{"php":{"php":"^7.4 || ^8.0","ext-json":"*","ext-phar":"*"}},"checksum":null,"signature":"https://github.com/maglnet/ComposerRequireChecker/releases/download/3.3.0/composer-require-checker.phar.asc"}}},"phpmd":{"api-version":"1.0.0","version":"1.0.0","type":"php-file","url":"https://phpcq.github.io/repository/phpmd-1.0.0.php","signature":null,"requirements":{"tool":{"phpmd":"^2.6.1"}},"checksum":{"type":"sha-512","value":"9b3adabd3893ecb372bd21b2a812576a67b41a81c064e5183569340d91cabd8664509c72863ed7c495426808c1514d4c97ca2246c3b2b6c4577ee89bd28edd95"},"tools":{"phpmd":{"version":"2.10.2","url":"https://github.com/phpmd/phpmd/releases/download/2.10.2/phpmd.phar","requirements":{"php":{"php":">=5.3.9","ext-xml":"*"}},"checksum":null,"signature":null}}},"phpcpd":{"api-version":"1.0.0","version":"1.0.0","type":"php-file","url":"https://phpcq.github.io/repository/phpcpd-1.0.0.php","signature":null,"requirements":{"tool":{"phpcpd":"^3.0 || ^4.0 || ^5.0"}},"checksum":{"type":"sha-512","value":"4aa6e285da8fc97e94de95313e3c6b6929c6e11f1b5273f2a6bd2b9e4b0a148e15e66bd3d62002e533b6bc9f13943f6baad2eb6c9207544b2a572182bcb8b8a2"},"tools":{"phpcpd":{"version":"5.0.2","url":"https://phar.phpunit.de/phpcpd-5.0.2.phar","requirements":{"php":{"php":"^7.3","ext-dom":"*"}},"checksum":{"type":"sha-256","value":"12e94af9928be2f33fd394d2cc5d96b3925de24d614381d06b3096cc9eeabbcb"},"signature":"https://phar.phpunit.de/phpcpd-5.0.2.phar.asc"}}},"phploc":{"api-version":"1.0.0","version":"1.0.0","type":"php-file","url":"https://phpcq.github.io/repository/phploc-1.0.0.php","signature":null,"requirements":{"tool":{"phploc":"^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0"}},"checksum":{"type":"sha-512","value":"f67b02d494796adf553cb3dd13ec06c1cb8e53c799954061749424251379541637538199afb3afa3c7a01cabd1cb6f1c53eb621f015dff9644c6c7cbf10c56d1"},"tools":{"phploc":{"version":"7.0.2","url":"https://phar.phpunit.de/phploc-7.0.2.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*","ext-json":"*"}},"checksum":{"type":"sha-256","value":"3d59778ec86faf25fd00e3a329b2f9ad4a3c751ca91601ea7dab70f887b0bf46"},"signature":"https://phar.phpunit.de/phploc-7.0.2.phar.asc"}}},"phpcs":{"api-version":"1.0.0","version":"1.0.0","type":"php-file","url":"https://phpcq.github.io/repository/phpcs-1.0.0.php","signature":null,"requirements":{"tool":{"phpcs":"^3.0 || ^2.0"}},"checksum":{"type":"sha-512","value":"6d7733daf111d615e504a66bf165a3fab6685e5aa8fe8c9e9395c4ba48777ae5866585edd3e9a9a64985707adcb1432cf58c68e826d9efdfb4b67cbb4c8c016a"},"tools":{"phpcs":{"version":"3.6.0","url":"https://github.com/squizlabs/PHP_CodeSniffer/releases/download/3.6.0/phpcs.phar","requirements":{"php":{"php":">=5.4.0","ext-tokenizer":"*","ext-xmlwriter":"*","ext-simplexml":"*"}},"checksum":null,"signature":"https://github.com/squizlabs/PHP_CodeSniffer/releases/download/3.6.0/phpcs.phar.asc"}}},"phpcbf":{"api-version":"1.0.0","version":"1.0.0","type":"php-file","url":"https://phpcq.github.io/repository/phpcbf-1.0.0.php","signature":null,"requirements":{"tool":{"phpcbf":"^3.0 || ^2.0"}},"checksum":{"type":"sha-512","value":"39b96cd91332c0d079f411706da08ba82c4bbd55831559aa2ad67efc4a09803d6343ee641c721be68ec05eebe114d751cbc0b844fd37510263affc7603f91e25"},"tools":{"phpcbf":{"version":"3.6.0","url":"https://github.com/squizlabs/PHP_CodeSniffer/releases/download/3.6.0/phpcbf.phar","requirements":{"php":{"php":">=5.4.0","ext-tokenizer":"*","ext-xmlwriter":"*","ext-simplexml":"*"}},"checksum":null,"signature":"https://github.com/squizlabs/PHP_CodeSniffer/releases/download/3.6.0/phpcbf.phar.asc"}}},"composer-normalize":{"api-version":"1.0.0","version":"1.0.0","type":"php-file","url":"https://phpcq.github.io/repository/composer-normalize-1.0.0.php","signature":null,"requirements":{"tool":{"composer-normalize":"^2.1"}},"checksum":{"type":"sha-512","value":"0a84b8656028b285000fa75d1f0e19a5efb156a9a738f4d41a738edb093ea8b5c392875b1167b8dbe4f644de09d6b2dfe1c39ca98f9f741dbcef2127a6f5e448"},"tools":{"composer-normalize":{"version":"2.15.0","url":"https://github.com/ergebnis/composer-normalize/releases/download/2.15.0/composer-normalize.phar","requirements":{"php":{"php":"^7.2 || ^8.0"}},"checksum":null,"signature":"https://github.com/ergebnis/composer-normalize/releases/download/2.15.0/composer-normalize.phar.asc"}}}},"tools":[]}
1+
{"plugins":{"phpunit":{"api-version":"1.0.0","version":"1.0.0.0","type":"php-file","url":"https://phpcq.github.io/repository/phpunit-1.0.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0"},"tool":{"phpunit":"^6.0 || ^7.0 || ^8.0 || ^9.0"}},"checksum":{"type":"sha-512","value":"c73f15658e3ba62665f09492ec91c3a6a715760bfaa88473a987538439fff442540148e086e46a6aa18ce55a3ea2fbf76caaa581384cb84a38859fcc609ae7e4"},"tools":{"phpunit":{"version":"9.5.10","url":"https://phar.phpunit.de/phpunit-9.5.10.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*","ext-json":"*","ext-libxml":"*","ext-mbstring":"*","ext-xml":"*","ext-xmlwriter":"*"}},"checksum":{"type":"sha-256","value":"a34b9db21de3e75ba2e609e68a4da94633f4a99cad8413fd3731a2cd9aa08ca8"},"signature":"https://phar.phpunit.de/phpunit-9.5.10.phar.asc"}}},"psalm":{"api-version":"1.0.0","version":"1.0.1.0","type":"php-file","url":"https://phpcq.github.io/repository/psalm-1.0.1.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"psalm":"^3.0 || ^4.0"}},"checksum":{"type":"sha-512","value":"fb591fbea784d65ea1b63ba597616c2dd6346958a61a9129aacf612e0deaa14c0de33d9a37cf81b5ed717f09cc3f1280149a0d46576fc838241070176710675f"},"tools":{"psalm":{"version":"4.11.1","url":"https://github.com/vimeo/psalm/releases/download/4.11.1/psalm.phar","requirements":{"php":{"php":"^7.1|^8","ext-SimpleXML":"*","ext-ctype":"*","ext-dom":"*","ext-json":"*","ext-libxml":"*","ext-mbstring":"*","ext-tokenizer":"*"}},"checksum":null,"signature":"https://github.com/vimeo/psalm/releases/download/4.11.1/psalm.phar.asc"}}},"composer-require-checker":{"api-version":"1.0.0","version":"1.0.0.0","type":"php-file","url":"https://phpcq.github.io/repository/composer-require-checker-1.0.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0"},"tool":{"composer-require-checker":"^3.0 | ^2.0"}},"checksum":{"type":"sha-512","value":"39507e83aee0cad92c00dcb4c755bd39c1a9157bbd919e2092aaf81b02bc5a84693335d8f3a73427e66c08c12ff81e35ed4be2d05ff33f2d368229c220a1307a"},"tools":{"composer-require-checker":{"version":"3.3.0","url":"https://github.com/maglnet/ComposerRequireChecker/releases/download/3.3.0/composer-require-checker.phar","requirements":{"php":{"php":"^7.4 || ^8.0","ext-json":"*","ext-phar":"*"}},"checksum":null,"signature":"https://github.com/maglnet/ComposerRequireChecker/releases/download/3.3.0/composer-require-checker.phar.asc"}}},"phpmd":{"api-version":"1.0.0","version":"1.0.0.0","type":"php-file","url":"https://phpcq.github.io/repository/phpmd-1.0.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpmd":"^2.6.1"}},"checksum":{"type":"sha-512","value":"72962e365ac6e8e47849d0b046d304c4eb4902479e0f7461e2ebe7705fc43acbbdb1dc9e483ac8c90c2636fa9a980288c82bcb3a958dae9845be2e25574f71e1"},"tools":{"phpmd":{"version":"2.10.2","url":"https://github.com/phpmd/phpmd/releases/download/2.10.2/phpmd.phar","requirements":{"php":{"php":">=5.3.9","ext-xml":"*"}},"checksum":null,"signature":null}}},"phpcpd":{"api-version":"1.0.0","version":"1.1.1.0","type":"php-file","url":"https://phpcq.github.io/repository/phpcpd-1.1.1.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpcpd":"^6.0"}},"checksum":{"type":"sha-512","value":"1189ce0bf3fade4cb4241f1d96f915ef8fc7651f4450dc79fdf464ee3d6be3009316f0d423ce2d4af9d76ad50807b7fdf4d77bfa6d9ee2c91d6eda32ea214433"},"tools":{"phpcpd":{"version":"6.0.3","url":"https://phar.phpunit.de/phpcpd-6.0.3.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*"}},"checksum":{"type":"sha-256","value":"2cbaea7cfda1bb4299d863eb075e977c3f49055dd16d88529fae5150d48a84cb"},"signature":"https://phar.phpunit.de/phpcpd-6.0.3.phar.asc"}}},"phploc":{"api-version":"1.0.0","version":"1.0.0.0","type":"php-file","url":"https://phpcq.github.io/repository/phploc-1.0.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*","ext-json":"*"},"tool":{"phploc":"^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0"}},"checksum":{"type":"sha-512","value":"f67b02d494796adf553cb3dd13ec06c1cb8e53c799954061749424251379541637538199afb3afa3c7a01cabd1cb6f1c53eb621f015dff9644c6c7cbf10c56d1"},"tools":{"phploc":{"version":"7.0.2","url":"https://phar.phpunit.de/phploc-7.0.2.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*","ext-json":"*"}},"checksum":{"type":"sha-256","value":"3d59778ec86faf25fd00e3a329b2f9ad4a3c751ca91601ea7dab70f887b0bf46"},"signature":"https://phar.phpunit.de/phploc-7.0.2.phar.asc"}}},"phpcs":{"api-version":"1.0.0","version":"1.0.0.0","type":"php-file","url":"https://phpcq.github.io/repository/phpcs-1.0.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpcs":"^3.0 || ^2.0","phpcbf":"^3.0 || ^2.0"}},"checksum":{"type":"sha-512","value":"e4f77d34c59ec8798d93492aa1e13e5221273963f108d32add1113bb1df713a1fe415f2c4e1faf3ab44c1a506d35a7bb73981fd8b6959cff1da7c2dc6d470de1"},"tools":{"phpcs":{"version":"3.6.1","url":"https://github.com/squizlabs/PHP_CodeSniffer/releases/download/3.6.1/phpcs.phar","requirements":{"php":{"php":">=5.4.0","ext-tokenizer":"*","ext-xmlwriter":"*","ext-simplexml":"*"}},"checksum":null,"signature":"https://github.com/squizlabs/PHP_CodeSniffer/releases/download/3.6.1/phpcs.phar.asc"},"phpcbf":{"version":"3.6.1","url":"https://github.com/squizlabs/PHP_CodeSniffer/releases/download/3.6.1/phpcbf.phar","requirements":{"php":{"php":">=5.4.0","ext-tokenizer":"*","ext-xmlwriter":"*","ext-simplexml":"*"}},"checksum":null,"signature":"https://github.com/squizlabs/PHP_CodeSniffer/releases/download/3.6.1/phpcbf.phar.asc"}}},"composer-normalize":{"api-version":"1.0.0","version":"1.0.0.0","type":"php-file","url":"https://phpcq.github.io/repository/composer-normalize-1.0.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0"},"tool":{"composer-normalize":"^2.1"}},"checksum":{"type":"sha-512","value":"0a84b8656028b285000fa75d1f0e19a5efb156a9a738f4d41a738edb093ea8b5c392875b1167b8dbe4f644de09d6b2dfe1c39ca98f9f741dbcef2127a6f5e448"},"tools":{"composer-normalize":{"version":"2.15.0","url":"https://github.com/ergebnis/composer-normalize/releases/download/2.15.0/composer-normalize.phar","requirements":{"php":{"php":"^7.2 || ^8.0"}},"checksum":null,"signature":"https://github.com/ergebnis/composer-normalize/releases/download/2.15.0/composer-normalize.phar.asc"}}}},"tools":[]}

.phpcq.yaml.dist

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,14 @@ phpcq:
2323
phpmd:
2424
signed: false
2525
phpcpd:
26-
version: ^1.0
26+
version: ^1.1.1
2727
signed: false
2828
phploc:
2929
version: ^1.0
3030
signed: false
3131
phpcs:
3232
version: ^1.0
3333
signed: false
34-
phpcbf:
35-
version: ^1.0
36-
signed: false
3734
composer-normalize:
3835
version: ^1.0
3936
signed: false
@@ -98,6 +95,7 @@ tasks:
9895
standard: PSR12
9996

10097
phpcbf:
98+
plugin: phpcs
10199
config:
102100
<<: *phpcs-config
103101
fix: true

composer.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)