diff --git a/.gitignore b/.gitignore index 2552e45..024586d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ .DS_Store node_modules /web/dist -/.vite \ No newline at end of file +/.vite +php-cs-fixer.cache diff --git a/composer.json b/composer.json index 63d205c..e6aace2 100644 --- a/composer.json +++ b/composer.json @@ -12,6 +12,7 @@ "require-dev": { "craftcms/ecs": "dev-main", "craftcms/generator": "^2.0.0", + "craftcms/phpstan": "dev-main", "yiisoft/yii2-shell": "^2.0.3" }, "autoload": { @@ -47,6 +48,7 @@ "@php -r \"file_exists('.env') || copy('.env.example.dev', '.env');\"" ], "ecs-check": "ecs check --ansi", - "ecs-fix": "ecs check --ansi --fix" + "ecs-fix": "ecs check --ansi --fix", + "phpstan": "phpstan --memory-limit=1G" } } diff --git a/composer.lock b/composer.lock index 2bd2f24..dbef022 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "40566550f5d1eb20d079d33a663fbd16", + "content-hash": "d6b39897ebfc270c5c0e75980e4528fb", "packages": [ { "name": "bacon/bacon-qr-code", @@ -7439,6 +7439,33 @@ }, "time": "2024-03-08T18:58:11+00:00" }, + { + "name": "craftcms/phpstan", + "version": "dev-main", + "source": { + "type": "git", + "url": "https://github.com/craftcms/phpstan.git", + "reference": "b61bba102b5ec8599406e6e29a28a20c915a6abc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/craftcms/phpstan/zipball/b61bba102b5ec8599406e6e29a28a20c915a6abc", + "reference": "b61bba102b5ec8599406e6e29a28a20c915a6abc", + "shasum": "" + }, + "require": { + "phpstan/phpstan": "^1.4.6" + }, + "default-branch": true, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "description": "PHPStan configuration for Craft CMS projects", + "support": { + "issues": "https://github.com/craftcms/phpstan/issues", + "source": "https://github.com/craftcms/phpstan/tree/main" + }, + "time": "2022-04-12T20:50:18+00:00" + }, { "name": "nette/php-generator", "version": "v4.1.4", @@ -7650,6 +7677,64 @@ }, "time": "2024-03-17T08:10:35+00:00" }, + { + "name": "phpstan/phpstan", + "version": "1.11.1", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "e524358f930e41a2b4cca1320e3b04fc26b39e0b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e524358f930e41a2b4cca1320e3b04fc26b39e0b", + "reference": "e524358f930e41a2b4cca1320e3b04fc26b39e0b", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + } + ], + "time": "2024-05-15T08:00:59+00:00" + }, { "name": "psy/psysh", "version": "v0.11.22", @@ -7948,7 +8033,8 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { - "craftcms/ecs": 20 + "craftcms/ecs": 20, + "craftcms/phpstan": 20 }, "prefer-stable": true, "prefer-lowest": false, diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..63dabc2 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,7 @@ +includes: + - vendor/craftcms/phpstan/phpstan.neon + +parameters: + level: 5 + paths: + - modules