Skip to content

Commit d95bb6a

Browse files
committed
Initial commit
0 parents  commit d95bb6a

13 files changed

+730
-0
lines changed

.composer-require-checker.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
"SPL"
11+
],
12+
"scan-files" : [
13+
"./src/*.php"
14+
]
15+
}

.github/workflows/diagnostics.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Code Quality Diagnostics
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
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: 'update'
22+
- php: 8.0
23+
output: '-o github-action -o default'
24+
phpcq_install: 'update'
25+
- php: 8.1
26+
output: '-o github-action -o default'
27+
phpcq_install: 'update'
28+
- php: 8.2
29+
output: '-o github-action -o default'
30+
phpcq_install: 'update'
31+
- php: 8.3
32+
output: '-o github-action -o default'
33+
phpcq_install: 'update'
34+
steps:
35+
- name: Pull source
36+
uses: actions/checkout@v2
37+
38+
- name: Setup PHP with PECL extension
39+
uses: shivammathur/setup-php@v2
40+
with:
41+
php-version: ${{ matrix.php }}
42+
43+
- name: Cache composer cache directory
44+
uses: actions/cache@v1
45+
env:
46+
cache-name: composer-cache-dir-${{ matrix.php }}
47+
with:
48+
path: ~/.cache/composer
49+
key: ${{ runner.os }}-build-${{ env.cache-name }}
50+
51+
- name: Cache vendor directory
52+
uses: actions/cache@v1
53+
env:
54+
cache-name: vendor-${{ matrix.php }}
55+
with:
56+
path: vendor
57+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
58+
restore-keys: |
59+
${{ runner.os }}-build-${{ env.cache-name }}-
60+
61+
- name: Cache phpcq directory
62+
uses: actions/cache@v1
63+
env:
64+
cache-name: phpcq-${{ matrix.php }}
65+
with:
66+
path: .phpcq
67+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/.phpcq.lock') }}
68+
restore-keys: |
69+
${{ runner.os }}-build-${{ env.cache-name }}-
70+
71+
- name: Install composer dependencies
72+
run: composer install
73+
74+
- name: Install phpcq toolchain
75+
run: ./vendor/bin/phpcq ${{ matrix.phpcq_install }} -v
76+
77+
- name: Run tests
78+
run: ./vendor/bin/phpcq run -v ${{ matrix.output }}
79+
80+
- name: Upload build directory to artifact
81+
uses: actions/upload-artifact@v2
82+
if: ${{ success() }} || ${{ failure() }}
83+
with:
84+
name: phpcq-builds-php-${{ matrix.php }}
85+
path: .phpcq/build/

.gitignore

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

.phpcq.lock

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

.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+
- repository.json
4+
- https://phpcq.github.io/repository/repository.json
5+
directories:
6+
- src
7+
- tests
8+
artifact: .phpcq/build
9+
composer:
10+
autodiscover: false
11+
12+
plugins:
13+
phpunit:
14+
version: ^1.0
15+
signed: false
16+
psalm:
17+
version: ^1.0
18+
signed: false
19+
composer-require-checker:
20+
version: ^1.0
21+
signed: false
22+
phpmd:
23+
version: ^1.0
24+
signed: false
25+
phpcpd:
26+
version: ^1.1
27+
signed: false
28+
phploc:
29+
version: ^1.0
30+
signed: false
31+
phpcs:
32+
version: ^1.0
33+
signed: false
34+
composer-normalize:
35+
version: ^1.0
36+
signed: false
37+
doctrine-coding-standard:
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+
- 5E6DDE998AB73B8E
53+
# Composer normalize
54+
- C00543248C87FB13
55+
# PHPMD
56+
- 9093F8B32E4815AA
57+
58+
tasks:
59+
fix:
60+
- composer-normalize-fix
61+
- phpcbf
62+
63+
verify:
64+
- composer-require-checker
65+
- composer-normalize
66+
67+
analyze:
68+
- phploc
69+
- phpcpd
70+
- phpmd
71+
- phpcs
72+
- psalm
73+
- phpunit
74+
75+
default:
76+
- verify
77+
- analyze
78+
79+
phpmd:
80+
plugin: phpmd
81+
config:
82+
ruleset:
83+
- codesize
84+
- controversial
85+
- naming
86+
- unusedcode
87+
88+
composer-require-checker:
89+
plugin: composer-require-checker
90+
config:
91+
config_file: '.composer-require-checker.json'
92+
93+
phpcs:
94+
plugin: phpcs
95+
config: &phpcs-config
96+
standard: PSR12
97+
phpcbf:
98+
plugin: phpcs
99+
config:
100+
<<: *phpcs-config
101+
fix: true
102+
103+
composer-normalize-fix:
104+
plugin: composer-normalize
105+
config:
106+
dry_run: false

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Doctrine coding standard plugin for phpcq
2+
3+
This plugin integrates the [Doctrine coding standard](https://www.doctrine-project.org/projects/coding-standard.html) into phpcq.
4+
5+
## Configuration
6+
7+
Extend your `.phpcq.yaml.dist` configuration by adding the plugin and configuring the task:
8+
9+
```yaml
10+
phpcq:
11+
plugins:
12+
doctrine-coding-standard:
13+
version: ^1.0
14+
signed: false
15+
16+
tasks:
17+
phpcs:
18+
uses:
19+
doctrine-coding-standard:
20+
# Optional define how standard option of phpcs configuration should be handled
21+
# Valid options are override, extend or ignore. It defaults to override
22+
phpcs_standard: extend
23+
```

composer.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "phpcq/plugin-doctrine-coding-standard",
3+
"description": "Provides the doctrine coding standard as phpcq plugin",
4+
"license": "MIT",
5+
"type": "phpcq-plugin",
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.4 || ^8.0",
22+
"ext-dom": "*",
23+
"phpcq/plugin-api": "^1.0@dev"
24+
},
25+
"require-dev": {
26+
"phpcq/runner-bootstrap": "^1.0@dev",
27+
"phpcq/schema": "^1.0@dev"
28+
},
29+
"autoload-dev": {
30+
"psr-4": {
31+
"Phpcq\\CodingStandardPluginTest\\": "tests"
32+
}
33+
}
34+
}

0 commit comments

Comments
 (0)