From 3ed3ee85b8af0e905ac11cdd8e8cc54be1559cd0 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 20 Feb 2024 08:30:00 +0000 Subject: [PATCH] Add PHPStan --- .gitignore | 4 +++ composer.json | 3 ++- composer.lock | 64 ++++++++++++++++++++++++++++++++++++++++++++++- phpstan.dist.neon | 9 +++++++ symfony.lock | 12 +++++++++ 5 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 phpstan.dist.neon diff --git a/.gitignore b/.gitignore index 5d85e7a..0b7f1db 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,7 @@ # Box /dist/ /vendor-bin/ + +###> phpstan/phpstan ### +phpstan.neon +###< phpstan/phpstan ### diff --git a/composer.json b/composer.json index 43071c2..8ffe0ec 100644 --- a/composer.json +++ b/composer.json @@ -66,6 +66,7 @@ } }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8" + "bamarni/composer-bin-plugin": "^1.8", + "phpstan/phpstan": "^1.10" } } diff --git a/composer.lock b/composer.lock index 29c4f8a..a28c1bc 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": "a1f732f5ff12a45f9756cf6322b15e05", + "content-hash": "9285c8d125fdc3707daaddece946aa0b", "packages": [ { "name": "psr/cache", @@ -2518,6 +2518,68 @@ "source": "https://github.com/bamarni/composer-bin-plugin/tree/1.8.2" }, "time": "2022-10-31T08:38:03+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "1.10.58", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "a23518379ec4defd9e47cbf81019526861623ec2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/a23518379ec4defd9e47cbf81019526861623ec2", + "reference": "a23518379ec4defd9e47cbf81019526861623ec2", + "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" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", + "type": "tidelift" + } + ], + "time": "2024-02-12T20:02:57+00:00" } ], "aliases": [], diff --git a/phpstan.dist.neon b/phpstan.dist.neon new file mode 100644 index 0000000..883c7b1 --- /dev/null +++ b/phpstan.dist.neon @@ -0,0 +1,9 @@ +parameters: + level: 8 + paths: + - bin/ + - config/ + - public/ + - src/ + - tests/ + - versa diff --git a/symfony.lock b/symfony.lock index 54b5a8a..079689c 100644 --- a/symfony.lock +++ b/symfony.lock @@ -1,4 +1,16 @@ { + "phpstan/phpstan": { + "version": "1.10", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "1.0", + "ref": "5e490cc197fb6bb1ae22e5abbc531ddc633b6767" + }, + "files": [ + "phpstan.dist.neon" + ] + }, "symfony/console": { "version": "7.0", "recipe": {