diff --git a/bin/console b/bin/console index bb15cc1..172e0e7 100644 --- a/bin/console +++ b/bin/console @@ -19,9 +19,9 @@ if (file_exists(__DIR__.'/../.env')) { } $app = new Application(); -$app->add(new FetchContributorsCommand()); -$app->add(new FetchPullRequestsMergedCommand()); -$app->add(new FetchRepositoriesCommand()); -$app->add(new GenerateNewContributorsCommand()); -$app->add(new GenerateTopCompaniesCommand()); +$app->addCommand(new FetchContributorsCommand()); +$app->addCommand(new FetchPullRequestsMergedCommand()); +$app->addCommand(new FetchRepositoriesCommand()); +$app->addCommand(new GenerateNewContributorsCommand()); +$app->addCommand(new GenerateTopCompaniesCommand()); $app->run(); diff --git a/composer.json b/composer.json index d076cb8..3e4c2a2 100644 --- a/composer.json +++ b/composer.json @@ -34,6 +34,7 @@ } }, "require-dev": { - "phpstan/phpstan": "^2.1" + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-symfony": "^2.0" } } diff --git a/composer.lock b/composer.lock index e8306ad..ccaed60 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": "12d0eedfd69c3bf936458178fa5943d1", + "content-hash": "90f479e7a2f6d5649ecc0134cac45882", "packages": [ { "name": "cache/adapter-common", @@ -2580,19 +2580,90 @@ } ], "time": "2025-12-05T10:24:31+00:00" + }, + { + "name": "phpstan/phpstan-symfony", + "version": "2.0.10", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan-symfony.git", + "reference": "5a7ab5319a0b0d856ddbe08f67a21b00b386107f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/5a7ab5319a0b0d856ddbe08f67a21b00b386107f", + "reference": "5a7ab5319a0b0d856ddbe08f67a21b00b386107f", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "php": "^7.4 || ^8.0", + "phpstan/phpstan": "^2.1.13" + }, + "conflict": { + "symfony/framework-bundle": "<3.0" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-phpunit": "^2.0.8", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6", + "psr/container": "1.1.2", + "symfony/config": "^5.4 || ^6.1", + "symfony/console": "^5.4 || ^6.1", + "symfony/dependency-injection": "^5.4 || ^6.1", + "symfony/form": "^5.4 || ^6.1", + "symfony/framework-bundle": "^5.4 || ^6.1", + "symfony/http-foundation": "^5.4 || ^6.1", + "symfony/messenger": "^5.4", + "symfony/polyfill-php80": "^1.24", + "symfony/serializer": "^5.4", + "symfony/service-contracts": "^2.2.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/2.0.10" + }, + "time": "2026-01-20T16:40:28+00:00" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { "ext-json": "*" }, - "platform-dev": {}, + "platform-dev": [], "platform-overrides": { "php": "8.4.0" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.2.0" } diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 7f88e86..01f44a2 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -12,4 +12,7 @@ parameters: - identifier: missingType.iterableValue path: src/Service/Github.php - count: 3 \ No newline at end of file + count: 3 +includes: + - vendor/phpstan/phpstan-symfony/extension.neon + - vendor/phpstan/phpstan-symfony/rules.neon diff --git a/src/Command/FetchContributorsCommand.php b/src/Command/FetchContributorsCommand.php index cf34882..5b37ed5 100644 --- a/src/Command/FetchContributorsCommand.php +++ b/src/Command/FetchContributorsCommand.php @@ -23,7 +23,7 @@ protected function configure(): void null, InputOption::VALUE_OPTIONAL, '', - $_ENV['GH_TOKEN'] ?? null + isset($_ENV['GH_TOKEN']) ? (string) $_ENV['GH_TOKEN'] : null ) ->addOption('repository', 'r', InputOption::VALUE_OPTIONAL, 'GitHub repository') ->addOption('config', 'c', InputOption::VALUE_OPTIONAL, '', 'config.dist.yml') diff --git a/src/Command/FetchPullRequestsMergedCommand.php b/src/Command/FetchPullRequestsMergedCommand.php index 2020aa6..6117878 100644 --- a/src/Command/FetchPullRequestsMergedCommand.php +++ b/src/Command/FetchPullRequestsMergedCommand.php @@ -22,7 +22,7 @@ protected function configure(): void null, InputOption::VALUE_OPTIONAL, '', - $_ENV['GH_TOKEN'] ?? null + isset($_ENV['GH_TOKEN']) ? (string) $_ENV['GH_TOKEN'] : null ); } diff --git a/src/Command/FetchRepositoriesCommand.php b/src/Command/FetchRepositoriesCommand.php index 532ac8e..59a1fa2 100644 --- a/src/Command/FetchRepositoriesCommand.php +++ b/src/Command/FetchRepositoriesCommand.php @@ -17,7 +17,7 @@ protected function configure(): void null, InputOption::VALUE_OPTIONAL, '', - $_ENV['GH_TOKEN'] ?? null + isset($_ENV['GH_TOKEN']) ? (string) $_ENV['GH_TOKEN'] : null ) ->addOption('config', 'c', InputOption::VALUE_OPTIONAL, '', 'config.dist.yml') ; diff --git a/src/Command/GenerateTopCompaniesCommand.php b/src/Command/GenerateTopCompaniesCommand.php index a9819e6..452127a 100644 --- a/src/Command/GenerateTopCompaniesCommand.php +++ b/src/Command/GenerateTopCompaniesCommand.php @@ -47,7 +47,7 @@ protected function configure(): void null, InputOption::VALUE_OPTIONAL, '', - $_ENV['GH_TOKEN'] ?? null + isset($_ENV['GH_TOKEN']) ? (string) $_ENV['GH_TOKEN'] : null ) ->addOption('config', 'c', InputOption::VALUE_OPTIONAL, '', 'config.dist.yml'); }