Skip to content

Commit 51dc2fa

Browse files
committed
craftcms/phpstan + ECS + CI
1 parent 302bc32 commit 51dc2fa

11 files changed

Lines changed: 975 additions & 666 deletions

File tree

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ README.md export-ignore
99
SECURITY.md export-ignore
1010
codeception.yml export-ignore
1111
composer.lock export-ignore
12+
ecs.php export-ignore
1213
gruntfile.js export-ignore
1314
gulpfile.js export-ignore
1415
package-lock.json export-ignore
1516
package.json export-ignore
17+
phpstan.neon export-ignore
1618
tests/ export-ignore
1719

1820
# Auto detect text files and perform LF normalization

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: ci
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
- v2
8+
pull_request:
9+
jobs:
10+
ecs:
11+
name: ECS
12+
uses: craftcms/.github/.github/workflows/ecs.yml@v1
13+
with:
14+
php_version: '7.2'
15+
phpstan:
16+
name: PHPStan
17+
uses: craftcms/.github/.github/workflows/phpstan.yml@v1
18+
with:
19+
php_version: '7.2'
20+
notify-slack:
21+
name: Notify Slack
22+
needs: [ ecs, phpstan ]
23+
if: ${{ always() }}
24+
uses: craftcms/.github/.github/workflows/notify-slack.yml@v1
25+
with:
26+
success: ${{ needs.ecs.result == 'success' && needs.phpstan.result == 'success' }}
27+
failure_text_prefix: <!subteam^SGFL9NKNZ>
28+
secrets:
29+
token: ${{ secrets.GITHUB_TOKEN }}
30+
slack_webhook_url: ${{ secrets.SLACK_PLUGIN_WEBHOOK_URL }}

composer.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,38 @@
2424
"docs": "https://github.com/craftcms/element-api/blob/v2/README.md",
2525
"rss": "https://github.com/craftcms/element-api/commits/v2.atom"
2626
},
27+
"minimum-stability": "dev",
28+
"prefer-stable": true,
2729
"require": {
2830
"craftcms/cms": "^3.6.0",
2931
"league/fractal": "^0.18.0"
3032
},
3133
"require-dev": {
32-
"phpstan/phpstan": "^0.12.96"
34+
"craftcms/ecs": "dev-main",
35+
"craftcms/phpstan": "dev-main"
3336
},
3437
"autoload": {
3538
"psr-4": {
3639
"craft\\elementapi\\": "src/"
3740
}
3841
},
3942
"scripts": {
43+
"check-cs": "ecs check --ansi",
44+
"fix-cs": "ecs check --ansi --fix",
4045
"phpstan": "phpstan --memory-limit=1G"
4146
},
4247
"extra": {
4348
"name": "Element API",
4449
"handle": "element-api",
4550
"documentationUrl": "https://github.com/craftcms/element-api/blob/v2/README.md"
51+
},
52+
"config": {
53+
"platform": {
54+
"php": "7.2.5"
55+
},
56+
"allow-plugins": {
57+
"yiisoft/yii2-composer": true,
58+
"craftcms/plugin-installer": true
59+
}
4660
}
4761
}

0 commit comments

Comments
 (0)