diff --git a/composer.json b/composer.json index 74e2d2c..a2206ad 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "phpunit/phpunit": "^9.5", "friendsofphp/php-cs-fixer": "^3.59", "prestashop/php-coding-standards": "^5", - "phpstan/phpstan": "^1", + "phpstan/phpstan": "^2", "symfony/var-dumper": "^5.4" }, "autoload": { @@ -25,5 +25,10 @@ }, "classmap": ["src"] }, - "license": "MIT" + "license": "MIT", + "config": { + "allow-plugins": { + "php-http/discovery": true + } + } } diff --git a/composer.lock b/composer.lock index 12ca557..d3a6748 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": "be038005681823c1592570e7d29bb169", + "content-hash": "2d6a883a7202a8bf7467e7707d866bb0", "packages": [ { "name": "cache/adapter-common", @@ -3822,20 +3822,20 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.8", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "f6a60a4d66142b8156c9da923f1972657bc4748c" + "reference": "ab4e9b4415a5fc9e4d27f7fe16c8bc9d067dcd6d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/f6a60a4d66142b8156c9da923f1972657bc4748c", - "reference": "f6a60a4d66142b8156c9da923f1972657bc4748c", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/ab4e9b4415a5fc9e4d27f7fe16c8bc9d067dcd6d", + "reference": "ab4e9b4415a5fc9e4d27f7fe16c8bc9d067dcd6d", "shasum": "" }, "require": { - "php": "^7.2|^8.0" + "php": "^7.4|^8.0" }, "conflict": { "phpstan/phpstan-shim": "*" @@ -3876,7 +3876,7 @@ "type": "github" } ], - "time": "2024-11-06T19:06:49+00:00" + "time": "2024-11-11T15:43:04+00:00" }, { "name": "phpunit/php-code-coverage", diff --git a/src/App/Command/GitHubMonthlyReportCommand.php b/src/App/Command/GitHubMonthlyReportCommand.php index 984a6de..4b533ec 100644 --- a/src/App/Command/GitHubMonthlyReportCommand.php +++ b/src/App/Command/GitHubMonthlyReportCommand.php @@ -166,12 +166,12 @@ private function generateReport(InputInterface $input, OutputInterface $output): $this->dateStart, $this->dateEnd, date('F', strtotime($this->dateStart)), - $this->results['issues_opened'], - $this->results['issues_closed'], - $this->results['issues_fixed'], - $this->results['prs_opened'], - $this->results['prs_closed'], - $this->results['prs_merged'], + (string) $this->results['issues_opened'], + (string) $this->results['issues_closed'], + (string) $this->results['issues_fixed'], + (string) $this->results['prs_opened'], + (string) $this->results['prs_closed'], + (string) $this->results['prs_merged'], $this->results['releases'], $this->results['core_prs'], $this->results['other_prs'], diff --git a/src/App/Command/GithubCQRSEndpointsCommand.php b/src/App/Command/GithubCQRSEndpointsCommand.php index dc1e9aa..f3e132b 100644 --- a/src/App/Command/GithubCQRSEndpointsCommand.php +++ b/src/App/Command/GithubCQRSEndpointsCommand.php @@ -17,7 +17,7 @@ class GithubCQRSEndpointsCommand extends Command { /** - * @var Github; + * @var Github */ protected $github; diff --git a/src/App/Command/GithubCheckModuleCommand.php b/src/App/Command/GithubCheckModuleCommand.php index 6a6848d..1101165 100644 --- a/src/App/Command/GithubCheckModuleCommand.php +++ b/src/App/Command/GithubCheckModuleCommand.php @@ -16,11 +16,11 @@ class GithubCheckModuleCommand extends Command { /** - * @var Github; + * @var Github */ protected $github; /** - * @var ModuleChecker; + * @var ModuleChecker */ protected $moduleChecker; diff --git a/src/App/Command/GithubCheckPRCommand.php b/src/App/Command/GithubCheckPRCommand.php index 7197f00..67573d0 100644 --- a/src/App/Command/GithubCheckPRCommand.php +++ b/src/App/Command/GithubCheckPRCommand.php @@ -27,23 +27,23 @@ class GithubCheckPRCommand extends Command ]; /** - * @var Filters; + * @var Filters */ protected $filters; /** - * @var Github; + * @var Github */ protected $github; /** - * @var array; + * @var array */ protected $orderBy; /** - * @var OutputInterface; + * @var OutputInterface */ protected $output; /** - * @var int; + * @var int */ protected $countRows = 0; diff --git a/src/App/Command/GithubCheckRepositoryCommand.php b/src/App/Command/GithubCheckRepositoryCommand.php index 045c83c..c9a65b2 100644 --- a/src/App/Command/GithubCheckRepositoryCommand.php +++ b/src/App/Command/GithubCheckRepositoryCommand.php @@ -13,7 +13,7 @@ class GithubCheckRepositoryCommand extends Command { /** - * @var Github; + * @var Github */ protected $github; @@ -63,8 +63,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int } $page = 1; + /** @var array> $results */ $results = []; do { + /** @var array> */ $repos = $this->github->getClient()->api('organization')->repositories('PrestaShop', $type, $page); ++$page; $results = array_merge($results, $repos); diff --git a/src/App/Command/GithubContributorsExportCommand.php b/src/App/Command/GithubContributorsExportCommand.php index a3e4a9e..76aa320 100644 --- a/src/App/Command/GithubContributorsExportCommand.php +++ b/src/App/Command/GithubContributorsExportCommand.php @@ -11,7 +11,7 @@ class GithubContributorsExportCommand extends Command { /** - * @var Github; + * @var Github */ protected $github; @@ -121,7 +121,7 @@ private function export(InputInterface $input, OutputInterface $output): void return ''; }, ''); - $branch = array_reduce($pullRequest['labels'], function (bool $carry, array $item) { + $branch = array_reduce($pullRequest['labels'], function (string $carry, array $item) { if (!empty($carry)) { return $carry; } diff --git a/src/App/Command/GithubContributorsStatsCommand.php b/src/App/Command/GithubContributorsStatsCommand.php index dcb161b..246c37e 100644 --- a/src/App/Command/GithubContributorsStatsCommand.php +++ b/src/App/Command/GithubContributorsStatsCommand.php @@ -12,7 +12,7 @@ class GithubContributorsStatsCommand extends Command { /** - * @var Github; + * @var Github */ protected $github; @@ -104,7 +104,7 @@ private function process(InputInterface $input, OutputInterface $output): void $pullRequest = $pullRequest['node']; $repository = $pullRequest['repository']['name']; $createdKey = substr($pullRequest['createdAt'], 0, 10); - $branch = array_reduce($pullRequest['labels']['nodes'], function (bool $carry, array $item) { + $branch = array_reduce($pullRequest['labels']['nodes'], function (string $carry, array $item) { if (!empty($carry)) { return $carry; } diff --git a/src/App/Command/GithubNotificationsCommand.php b/src/App/Command/GithubNotificationsCommand.php index 2bad58d..84be910 100644 --- a/src/App/Command/GithubNotificationsCommand.php +++ b/src/App/Command/GithubNotificationsCommand.php @@ -13,7 +13,7 @@ class GithubNotificationsCommand extends Command { /** - * @var Github; + * @var Github */ protected $github; diff --git a/src/App/Command/GithubReleaseNoteCommand.php b/src/App/Command/GithubReleaseNoteCommand.php index 1c7c853..2b6a4e7 100644 --- a/src/App/Command/GithubReleaseNoteCommand.php +++ b/src/App/Command/GithubReleaseNoteCommand.php @@ -18,17 +18,17 @@ class GithubReleaseNoteCommand extends Command { /** - * @var Github; + * @var Github */ protected $github; /** - * @var OutputInterface; + * @var OutputInterface */ protected $output; /** - * @var int; + * @var int */ protected $countRows = 0; diff --git a/src/App/Command/GithubStatsCommand.php b/src/App/Command/GithubStatsCommand.php index 8263d7e..c0f4c5a 100644 --- a/src/App/Command/GithubStatsCommand.php +++ b/src/App/Command/GithubStatsCommand.php @@ -14,7 +14,7 @@ class GithubStatsCommand extends Command { /** - * @var Github; + * @var Github */ protected $github; diff --git a/src/App/Service/Github.php b/src/App/Service/Github.php index a92af4a..0c31096 100644 --- a/src/App/Service/Github.php +++ b/src/App/Service/Github.php @@ -13,7 +13,7 @@ class Github { /** - * @var Client; + * @var Client */ protected $client; diff --git a/tests/App/Service/ModuleFetcherTest.php b/tests/App/Service/ModuleFetcherTest.php index 27e4055..048e463 100644 --- a/tests/App/Service/ModuleFetcherTest.php +++ b/tests/App/Service/ModuleFetcherTest.php @@ -17,7 +17,6 @@ public function testGetModules(array $apiReturn, array $expected) $moduleFetcher = new ModuleFetcher($this->getMockGithub($apiReturn)); $modules = $moduleFetcher->getModules(); - $this->assertIsArray($modules); $this->assertEquals($expected, $modules); }