Skip to content

Commit

Permalink
PHPstan & ECS
Browse files Browse the repository at this point in the history
  • Loading branch information
janhenckens committed Feb 9, 2024
1 parent ccc9b8b commit 5db43e8
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Code Quality
on:
workflow_dispatch:
push:
branches:
- develop
- develop-v5
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
name: ci
uses: studioespresso/.github/.github/workflows/ci.yml@main
with:
craft_version: '5'
jobs: '["ecs", "phpstan"]'
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
/composer.lock
/vendor
19 changes: 17 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,22 @@
"authors": [
{
"name": "Studio Espresso",
"homepage": "https://studioespresso.dev"
"homepage": "https://www.studioespresso.co"
}
],
"require": {
"craftcms/cms": "^5.0.0-alpha",
"unsplash/unsplash": "^3.0.0"
},
"require-dev": {
"craftcms/ecs": "dev-main",
"craftcms/phpstan": "dev-main"
},
"scripts": {
"check-cs": "ecs check --ansi",
"fix-cs": "ecs check --ansi --fix",
"phpstan": "phpstan --memory-limit=1G"
},
"autoload": {
"psr-4": {
"studioespresso\\splashingimages\\": "src/"
Expand All @@ -44,5 +53,11 @@
"type": "github",
"url": "https://github.com/sponsors/janhenckens"
}
]
],
"config": {
"allow-plugins": {
"yiisoft/yii2-composer": true,
"craftcms/plugin-installer": true
}
}
}
14 changes: 14 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

use craft\ecs\SetList;
use Symplify\EasyCodingStandard\Config\ECSConfig;

return static function(ECSConfig $ecsConfig): void {
$ecsConfig->paths([
__DIR__ . '/src',
__FILE__,
]);

$ecsConfig->parallel();
$ecsConfig->sets([SetList::CRAFT_CMS_4]);
};
7 changes: 7 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
includes:
- vendor/craftcms/phpstan/phpstan.neon

parameters:
level: 1
paths:
- src

0 comments on commit 5db43e8

Please sign in to comment.