From 31636b93b1eac76b324163e427fc942d267af262 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 10:08:37 +0000 Subject: [PATCH 1/2] build(deps-dev): bump phpstan/phpstan from 1.12.9 to 2.0.2 Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.12.9 to 2.0.2. - [Release notes](https://github.com/phpstan/phpstan/releases) - [Changelog](https://github.com/phpstan/phpstan/blob/2.0.x/CHANGELOG.md) - [Commits](https://github.com/phpstan/phpstan/compare/1.12.9...2.0.2) --- updated-dependencies: - dependency-name: phpstan/phpstan dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index cc5f83d..788c03d 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "require-dev": { "ergebnis/composer-normalize": "^2.41", "friendsofphp/php-cs-fixer": "^3.45", - "phpstan/phpstan": "^1.10", + "phpstan/phpstan": "^2.0", "phpunit/phpunit": "^11.0", "symfony/browser-kit": "~7.1.0", "symfony/css-selector": "~7.1.0", diff --git a/composer.lock b/composer.lock index 3639273..9fc22fe 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": "8fa94c54f0db0bfe347e02b260e0d78e", + "content-hash": "cd925fc1bbb64f665b09ee88c8c167a5", "packages": [ { "name": "beberlei/doctrineextensions", @@ -5317,20 +5317,20 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.9", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "ceb937fb39a92deabc02d20709cf14b2c452502c" + "reference": "6c98c7600fc717b2c78c11ef60040d5b1e359c82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/ceb937fb39a92deabc02d20709cf14b2c452502c", - "reference": "ceb937fb39a92deabc02d20709cf14b2c452502c", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/6c98c7600fc717b2c78c11ef60040d5b1e359c82", + "reference": "6c98c7600fc717b2c78c11ef60040d5b1e359c82", "shasum": "" }, "require": { - "php": "^7.2|^8.0" + "php": "^7.4|^8.0" }, "conflict": { "phpstan/phpstan-shim": "*" @@ -5371,7 +5371,7 @@ "type": "github" } ], - "time": "2024-11-10T17:10:04+00:00" + "time": "2024-11-17T14:17:00+00:00" }, { "name": "phpunit/php-code-coverage", From 9c80c751158b70437850070550d434eebab94910 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Mon, 25 Nov 2024 16:51:59 +0100 Subject: [PATCH 2/2] Fixed CI --- src/Controller/ImportController.php | 4 ++-- src/Entity/Execution.php | 2 +- src/Repository/ExecutionRepository.php | 4 ++-- src/Repository/SettingsRepository.php | 4 ++-- src/Repository/SuiteRepository.php | 4 ++-- src/Repository/TestRepository.php | 4 ++-- src/Service/ReportSuiteBuilder.php | 4 ++-- tests/Controller/ReportControllerTest.php | 12 +++++++----- 8 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/Controller/ImportController.php b/src/Controller/ImportController.php index 58c42b0..bd05406 100644 --- a/src/Controller/ImportController.php +++ b/src/Controller/ImportController.php @@ -26,7 +26,7 @@ class ImportController extends AbstractController private ?string $filename; - private ?string $version; + private string $version; private ?\stdClass $jsonContent; @@ -36,7 +36,7 @@ class ImportController extends AbstractController private ?string $campaign; - private ?\DateTime $startDate; + private \DateTime $startDate; public function __construct( ExecutionRepository $executionRepository, diff --git a/src/Entity/Execution.php b/src/Entity/Execution.php index 1e288b7..d0ca81a 100644 --- a/src/Entity/Execution.php +++ b/src/Entity/Execution.php @@ -330,7 +330,7 @@ public function getInsertionEndDate(): ?\DateTimeInterface return $this->insertion_end_date; } - public function setInsertionEndDate(\DateTimeInterface $insertion_end_date): static + public function setInsertionEndDate(?\DateTimeInterface $insertion_end_date): static { $this->insertion_end_date = $insertion_end_date; diff --git a/src/Repository/ExecutionRepository.php b/src/Repository/ExecutionRepository.php index 7c91cc4..5ce3692 100644 --- a/src/Repository/ExecutionRepository.php +++ b/src/Repository/ExecutionRepository.php @@ -10,9 +10,9 @@ * @extends ServiceEntityRepository * * @method Execution|null find($id, $lockMode = null, $lockVersion = null) - * @method Execution|null findOneBy(array $criteria, array $orderBy = null) + * @method Execution|null findOneBy(array $criteria, array $orderBy = null) * @method Execution[] findAll() - * @method Execution[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + * @method Execution[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ class ExecutionRepository extends ServiceEntityRepository { diff --git a/src/Repository/SettingsRepository.php b/src/Repository/SettingsRepository.php index 3a9f2cf..be8c9db 100644 --- a/src/Repository/SettingsRepository.php +++ b/src/Repository/SettingsRepository.php @@ -10,9 +10,9 @@ * @extends ServiceEntityRepository * * @method Settings|null find($id, $lockMode = null, $lockVersion = null) - * @method Settings|null findOneBy(array $criteria, array $orderBy = null) + * @method Settings|null findOneBy(array $criteria, array $orderBy = null) * @method Settings[] findAll() - * @method Settings[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + * @method Settings[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ class SettingsRepository extends ServiceEntityRepository { diff --git a/src/Repository/SuiteRepository.php b/src/Repository/SuiteRepository.php index f08ad84..87dd797 100644 --- a/src/Repository/SuiteRepository.php +++ b/src/Repository/SuiteRepository.php @@ -10,9 +10,9 @@ * @extends ServiceEntityRepository * * @method Suite|null find($id, $lockMode = null, $lockVersion = null) - * @method Suite|null findOneBy(array $criteria, array $orderBy = null) + * @method Suite|null findOneBy(array $criteria, array $orderBy = null) * @method Suite[] findAll() - * @method Suite[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + * @method Suite[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ class SuiteRepository extends ServiceEntityRepository { diff --git a/src/Repository/TestRepository.php b/src/Repository/TestRepository.php index 34b8a63..bc9a669 100644 --- a/src/Repository/TestRepository.php +++ b/src/Repository/TestRepository.php @@ -12,9 +12,9 @@ * @extends ServiceEntityRepository * * @method Test|null find($id, $lockMode = null, $lockVersion = null) - * @method Test|null findOneBy(array $criteria, array $orderBy = null) + * @method Test|null findOneBy(array $criteria, array $orderBy = null) * @method Test[] findAll() - * @method Test[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + * @method Test[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ class TestRepository extends ServiceEntityRepository { diff --git a/src/Service/ReportSuiteBuilder.php b/src/Service/ReportSuiteBuilder.php index 1bcc9f5..b5d7e30 100644 --- a/src/Service/ReportSuiteBuilder.php +++ b/src/Service/ReportSuiteBuilder.php @@ -108,7 +108,7 @@ public function toArray(): array } /** - * @return array> + * @return array|string>|int>|int|string|null> */ private function formatSuite(Suite $suite): array { @@ -157,7 +157,7 @@ private function formatSuite(Suite $suite): array } /** - * @return array + * @return array */ private function formatTest(Test $test): array { diff --git a/tests/Controller/ReportControllerTest.php b/tests/Controller/ReportControllerTest.php index 69b9f9f..39f936d 100644 --- a/tests/Controller/ReportControllerTest.php +++ b/tests/Controller/ReportControllerTest.php @@ -210,7 +210,7 @@ public function testReportID(int $reportId, array $campaigns): void } /** - * @return array> + * @return array>> */ public static function dataProviderReportID(): array { @@ -421,12 +421,10 @@ private function partialCompareTest(array $expected, array $actual): void } /** - * @param array $item + * @param array $item */ private function partialTestSuite(int $executionId, int $id, array $item, ?int $idParent = null, ?bool $hasChildrenData = null): void { - $this->assertIsInt($id); - $this->assertArrayHasKey('id', $item); $this->assertIsInt($item['id']); $this->assertEquals($item['id'], $id); @@ -465,15 +463,18 @@ private function partialTestSuite(int $executionId, int $id, array $item, ?int $ if ($item['hasSuites']) { $this->assertArrayHasKey('suites', $item); + // @phpstan-ignore-next-line : https://github.com/phpstan/phpstan/issues/8438 $this->assertIsArray($item['suites']); $this->assertGreaterThan(0, count($item['suites'])); foreach ($item['suites'] as $suiteChildId => $suiteChild) { + // @phpstan-ignore-next-line : https://github.com/phpstan/phpstan/issues/8438 $this->assertIsInt($suiteChildId); $this->partialTestSuite($executionId, $suiteChildId, $suiteChild, $id); } } if ($item['hasTests']) { $this->assertArrayHasKey('tests', $item); + // @phpstan-ignore-next-line : https://github.com/phpstan/phpstan/issues/8438 $this->assertIsArray($item['tests']); $this->assertGreaterThan(0, count($item['tests'])); foreach ($item['tests'] as $testItem) { @@ -483,6 +484,7 @@ private function partialTestSuite(int $executionId, int $id, array $item, ?int $ if (is_bool($hasChildrenData) && $hasChildrenData) { $this->assertArrayHasKey('childrenData', $item); + // @phpstan-ignore-next-line : https://github.com/phpstan/phpstan/issues/8438 $this->assertIsArray($item['childrenData']); $this->assertArrayHasKey('totalPasses', $item['childrenData']); $this->assertIsInt($item['childrenData']['totalPasses']); @@ -502,7 +504,7 @@ private function partialTestSuite(int $executionId, int $id, array $item, ?int $ } /** - * @param array $test + * @param array $test */ private function partialTestTest(int $suiteId, array $test): void {