Skip to content

Commit a0b7fbe

Browse files
committed
Initial commit
0 parents  commit a0b7fbe

13 files changed

+657
-0
lines changed

.composer-require-checker.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"symbol-whitelist" : [
3+
"null", "true", "false",
4+
"static", "self", "parent",
5+
"array", "string", "int", "float", "bool", "iterable", "callable", "void", "object"
6+
],
7+
"php-core-extensions" : [
8+
"Core",
9+
"standard"
10+
],
11+
"scan-files" : [
12+
"./src/*.php"
13+
]
14+
}

.github/workflows/diagnostics.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Code Quality Diagnostics
2+
3+
env:
4+
PHPCQ_DIRECTORY: ./phpcq-runner
5+
6+
on: [pull_request, push]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Pull source
14+
uses: actions/checkout@v2
15+
16+
- name: Setup PHP with PECL extension
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: '7.4'
20+
coverage: xdebug2
21+
22+
- name: Cache composer cache directory
23+
uses: actions/cache@v1
24+
env:
25+
cache-name: composer-cache-dir
26+
with:
27+
path: ~/.cache/composer
28+
key: ${{ runner.os }}-build-${{ env.cache-name }}
29+
30+
- name: Install composer dependencies
31+
run: composer install
32+
33+
- name: Cache vendor directory
34+
uses: actions/cache@v1
35+
env:
36+
cache-name: vendor
37+
with:
38+
path: vendor
39+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
40+
restore-keys: |
41+
${{ runner.os }}-build-${{ env.cache-name }}-
42+
43+
- name: Install phpcq toolchain
44+
run: ./vendor/bin/phpcq install -v
45+
46+
- name: Cache phpcq directory
47+
uses: actions/cache@v1
48+
env:
49+
cache-name: phpcq
50+
with:
51+
path: .phpcq
52+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/.phpcq.lock') }}
53+
restore-keys: |
54+
${{ runner.os }}-build-${{ env.cache-name }}-
55+
56+
- name: Run tests
57+
run: ./vendor/bin/phpcq run -o github-action -o default

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
vendor
2+
.phpcq
3+
.phpcq.yaml
4+
.phpunit.result.cache

.phpcq.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +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":[]}

.phpcq.yaml.dist

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
phpcq:
2+
repositories:
3+
- https://phpcq.github.io/repository/repository.json
4+
directories:
5+
- src
6+
- tests
7+
artifact: .phpcq/build
8+
9+
plugins:
10+
phpunit:
11+
version: ^1.0
12+
signed: false
13+
psalm:
14+
version: ^1.0
15+
signed: false
16+
composer-require-checker:
17+
version: ^1.0
18+
signed: false
19+
phpmd:
20+
version: ^1.0
21+
signed: false
22+
requirements:
23+
phpmd:
24+
signed: false
25+
phpcpd:
26+
version: ^1.0
27+
signed: false
28+
phploc:
29+
version: ^1.0
30+
signed: false
31+
phpcs:
32+
version: ^1.0
33+
signed: false
34+
phpcbf:
35+
version: ^1.0
36+
signed: false
37+
composer-normalize:
38+
version: ^1.0
39+
signed: false
40+
trusted-keys:
41+
# composer-require-checker
42+
- 033E5F8D801A2F8D
43+
44+
- 4AA394086372C20A
45+
# psalm
46+
- 8A03EA3B385DBAA1
47+
- 12CE0F1D262429A5
48+
49+
- D2CCAC42F6295E7D
50+
# PHP_CodeSniffer
51+
- 31C7E470E2138192
52+
# Composer normalize
53+
- C00543248C87FB13
54+
# phpmd
55+
- 0F9684B8B16B7AB0
56+
57+
chains:
58+
fix:
59+
- composer-normalize
60+
- phpcbf
61+
verify:
62+
- composer-require-checker
63+
- composer-normalize
64+
analyze:
65+
- phploc
66+
- phpcpd
67+
- phpmd
68+
- phpcs
69+
- psalm
70+
- phpunit
71+
default:
72+
- composer-require-checker
73+
- composer-normalize
74+
- phploc
75+
- phpcpd
76+
- phpmd
77+
- phpcs
78+
- psalm
79+
- phpunit
80+
81+
tasks:
82+
phpmd:
83+
config:
84+
ruleset:
85+
- cleancode
86+
- codesize
87+
- controversial
88+
- design
89+
- naming
90+
- unusedcode
91+
92+
composer-require-checker:
93+
config:
94+
config_file: '.composer-require-checker.json'
95+
96+
phpcs:
97+
config: &phpcs-config
98+
standard: PSR12
99+
100+
phpcbf:
101+
config:
102+
<<: *phpcs-config
103+
fix: true
104+
105+
phpcpd:
106+
config:

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# phpcs/phpcbf plugin for phpcq.
2+
3+
This plugin provides [phpcs](https://github.com/squizlabs/PHP_CodeSniffer) integration for phpcq.
4+
5+
It also provides a "fix" option, which runs [phpcbf](https://github.com/squizlabs/PHP_CodeSniffer) on the code base.

composer.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "phpcq/plugin-phpcs",
3+
"type": "phpcq-plugin",
4+
"description": "phpcs/phpcbf plugin for phpcq.",
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "Christian Schiffler",
9+
"email": "[email protected]",
10+
"homepage": "https://cyberspectrum.de",
11+
"role": "lead"
12+
},
13+
{
14+
"name": "David Molineus",
15+
"email": "[email protected]",
16+
"homepage": "https://netzmacht.de",
17+
"role": "lead"
18+
}
19+
],
20+
"require": {
21+
"php": "^7.3 || ^8.0",
22+
"phpcq/plugin-api": "^1.0@dev"
23+
},
24+
"require-dev": {
25+
"phpcq/runner-bootstrap": "^1.0@dev",
26+
"phpcq/schema": "^1.0@dev"
27+
},
28+
"autoload-dev": {
29+
"psr-4": {
30+
"Phpcq\\PhpcsPluginTest\\": "tests"
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)