Skip to content

Commit 35b5287

Browse files
committed
feat: Add phpstan and ecs code linting
1 parent b92f5bf commit 35b5287

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

composer.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "nystudio107/craft-transcoder",
33
"description": "Transcode video & audio files to various formats, and provide video thumbnails",
44
"type": "craft-plugin",
5-
"version": "4.0.1",
5+
"version": "4.0.2",
66
"keywords": [
77
"craft",
88
"cms",
@@ -33,6 +33,16 @@
3333
"nystudio107/craft-plugin-vite": "^4.0.0",
3434
"mikehaertl/php-shellcommand": "~1.2"
3535
},
36+
"require-dev": {
37+
"craftcms/ecs": "dev-main",
38+
"craftcms/phpstan": "dev-main",
39+
"craftcms/rector": "dev-main"
40+
},
41+
"scripts": {
42+
"phpstan": "phpstan --ansi --memory-limit=1G",
43+
"check-cs": "ecs check --ansi",
44+
"fix-cs": "ecs check --fix --ansi"
45+
},
3646
"config": {
3747
"allow-plugins": {
3848
"craftcms/plugin-installer": true,

ecs.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
use craft\ecs\SetList;
4+
use Symplify\EasyCodingStandard\Config\ECSConfig;
5+
6+
return static function(ECSConfig $ecsConfig): void {
7+
$ecsConfig->paths([
8+
__DIR__ . '/src',
9+
__FILE__,
10+
]);
11+
$ecsConfig->parallel();
12+
$ecsConfig->sets([SetList::CRAFT_CMS_4]);
13+
};

phpstan.neon

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
includes:
2+
- %currentWorkingDirectory%/vendor/craftcms/phpstan/phpstan.neon
3+
4+
parameters:
5+
level: 5
6+
paths:
7+
- src

0 commit comments

Comments
 (0)