diff --git a/composer.json b/composer.json index 41b0bbccde38c1b9b81862b23956b462edcb9850..b9a94448d838c074a6b83d2775915e72b6eea30a 100644 --- a/composer.json +++ b/composer.json @@ -22,6 +22,7 @@ "friendsofphp/php-cs-fixer": "^3.0", "phpstan/phpstan": "^1.0.0", "phpstan/phpstan-phpunit": "^1.0.0", + "phpstan/phpstan-symfony": "^1.2", "phpunit/phpunit": "^9", "symfony/browser-kit": "^5.3", "symfony/http-client": "^5.3", diff --git a/composer.lock b/composer.lock index 9974061eb38671b82b979a1554a3018e019a6f9d..b86b4feb64ee96b0862ae90b3678ed9e87236fbe 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": "a19d06896f68569849e63859ca44f78f", + "content-hash": "eed6b1f42772cd5eb14ac55ad1e4e3c5", "packages": [ { "name": "api-platform/core", @@ -8099,6 +8099,77 @@ }, "time": "2022-04-20T15:24:25+00:00" }, + { + "name": "phpstan/phpstan-symfony", + "version": "1.2.9", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan-symfony.git", + "reference": "f4cb3b8915d3656e780f305f01c86b70ff933272" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/f4cb3b8915d3656e780f305f01c86b70ff933272", + "reference": "f4cb3b8915d3656e780f305f01c86b70ff933272", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "php": "^7.2 || ^8.0", + "phpstan/phpstan": "^1.8.2" + }, + "conflict": { + "symfony/framework-bundle": "<3.0" + }, + "require-dev": { + "nikic/php-parser": "^4.13.0", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-phpunit": "^1.0", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "psr/container": "1.0 || 1.1.1", + "symfony/config": "^4.2 || ^5.0", + "symfony/console": "^4.0 || ^5.0", + "symfony/dependency-injection": "^4.0 || ^5.0", + "symfony/form": "^4.0 || ^5.0", + "symfony/framework-bundle": "^4.4 || ^5.0", + "symfony/http-foundation": "^5.1", + "symfony/messenger": "^4.2 || ^5.0", + "symfony/polyfill-php80": "^1.24", + "symfony/serializer": "^4.0 || ^5.0" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "extension.neon", + "rules.neon" + ] + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Lukáš Unger", + "email": "looky.msc@gmail.com", + "homepage": "https://lookyman.net" + } + ], + "description": "Symfony Framework extensions and rules for PHPStan", + "support": { + "issues": "https://github.com/phpstan/phpstan-symfony/issues", + "source": "https://github.com/phpstan/phpstan-symfony/tree/1.2.9" + }, + "time": "2022-08-05T20:13:38+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "9.2.15", diff --git a/phpstan.neon b/phpstan.neon index 0f56a1da8c875fde4a7da6d2e20cc12e2a599887..a55bb9be0fe74e75a57d0682595e92ab1988dfb9 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,13 +1,9 @@ includes: - vendor/phpstan/phpstan-phpunit/extension.neon + - vendor/phpstan/phpstan-symfony/extension.neon parameters: inferPrivatePropertyTypeFromConstructor: true level: 3 paths: - src - excludePaths: - - tests/bootstrap.php - ignoreErrors: - - message: '#.*NodeDefinition::children.*#' - path: ./src/DependencyInjection \ No newline at end of file diff --git a/tests/bootstrap.php b/tests/bootstrap.php index cc712a19ad9b3e163ccc7e5d4ca02cba247445ae..eddbb52dd25c5e668ee48fa6f7b084492512d72d 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -2,12 +2,4 @@ declare(strict_types=1); -use Symfony\Component\Dotenv\Dotenv; - require dirname(__DIR__).'/vendor/autoload.php'; - -if (file_exists(dirname(__DIR__).'/config/bootstrap.php')) { - require dirname(__DIR__).'/config/bootstrap.php'; -} elseif (method_exists(Dotenv::class, 'bootEnv')) { - (new Dotenv())->bootEnv(dirname(__DIR__).'/.env'); -}