From 1ac1693e550caa1af37c2875d742dcf4db4e9a8e Mon Sep 17 00:00:00 2001 From: Doug Wright Date: Fri, 17 Nov 2023 11:19:45 +0000 Subject: [PATCH] Drop PHP 7.3 --- .github/workflows/ci.yml | 5 ----- composer.json | 2 +- src/Controller/Cli/CodeCoverageController.php | 4 ---- src/Extension.php | 15 --------------- src/Service/ReportService.php | 5 +---- src/Subscriber/EventSubscriber.php | 12 +++--------- tests/EventSubscriberTest.php | 8 ++++---- 7 files changed, 9 insertions(+), 42 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4b27a6..8c80bcd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,6 @@ jobs: - "8.1" - "8.0" - "7.4" - - "7.3" php-code-coverage-version: - "^10.0" @@ -43,14 +42,10 @@ jobs: exclude: - php-version: "7.4" symfony-version: "^6.0" - - php-version: "7.3" - symfony-version: "^6.0" - php-version: "8.0" php-code-coverage-version: "^10.0" - php-version: "7.4" php-code-coverage-version: "^10.0" - - php-version: "7.3" - php-code-coverage-version: "^10.0" steps: - uses: actions/checkout@v4 diff --git a/composer.json b/composer.json index 90c55a1..a8bf22c 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ } ], "require": { - "php": "^7.3 || ^8.0", + "php": "^7.4 || ^8.0", "composer-runtime-api": "^2.0", "behat/behat": "^3.10", "composer/semver": "^3.0", diff --git a/src/Controller/Cli/CodeCoverageController.php b/src/Controller/Cli/CodeCoverageController.php index bb9e99e..52bef4a 100644 --- a/src/Controller/Cli/CodeCoverageController.php +++ b/src/Controller/Cli/CodeCoverageController.php @@ -14,16 +14,12 @@ class CodeCoverageController implements Controller { - /** - * {@inheritdoc} - */ public function configure(Command $command): void { $command->addOption('no-coverage', null, InputOption::VALUE_NONE, 'Skip Code Coverage generation'); } /** - * {@inheritdoc} * @codeCoverageIgnore */ public function execute(InputInterface $input, OutputInterface $output): void diff --git a/src/Extension.php b/src/Extension.php index d4e27ff..0b3b930 100644 --- a/src/Extension.php +++ b/src/Extension.php @@ -37,16 +37,10 @@ class Extension implements ExtensionInterface { - /** - * {@inheritdoc} - */ public function initialize(ExtensionManager $extensionManager): void { } - /** - * {@inheritdoc} - */ public function load(ContainerBuilder $container, array $config): void { $container->registerForAutoconfiguration(Controller::class)->addTag(CliExtension::CONTROLLER_TAG); @@ -61,9 +55,6 @@ public function load(ContainerBuilder $container, array $config): void $container->setParameter('behat.code_coverage.config.cache', $config['cache']); } - /** - * {@inheritdoc} - */ public function configure(ArrayNodeDefinition $builder): void { $builder @@ -185,17 +176,11 @@ public function configure(ArrayNodeDefinition $builder): void ->end(); } - /** - * {@inheritdoc} - */ public function getConfigKey() { return 'code_coverage'; } - /** - * {@inheritdoc} - */ public function process(ContainerBuilder $container): void { /** @var InputInterface $input */ diff --git a/src/Service/ReportService.php b/src/Service/ReportService.php index 790c204..341ab2b 100644 --- a/src/Service/ReportService.php +++ b/src/Service/ReportService.php @@ -24,10 +24,7 @@ class ReportService { - /** - * @var array - */ - private $config; + private array $config; /** * Constructor. diff --git a/src/Subscriber/EventSubscriber.php b/src/Subscriber/EventSubscriber.php index 4325dbd..ce36bf0 100644 --- a/src/Subscriber/EventSubscriber.php +++ b/src/Subscriber/EventSubscriber.php @@ -15,17 +15,11 @@ class EventSubscriber implements EventSubscriberInterface { - /** - * @var CodeCoverage - */ - private $coverage; + private ?CodeCoverage $coverage; - /** - * @var ReportService - */ - private $reportService; + private ReportService $reportService; - public function __construct(ReportService $reportService, CodeCoverage $coverage = null) + public function __construct(ReportService $reportService, ?CodeCoverage $coverage) { $this->reportService = $reportService; $this->coverage = $coverage; diff --git a/tests/EventSubscriberTest.php b/tests/EventSubscriberTest.php index e3d9d17..f0519df 100644 --- a/tests/EventSubscriberTest.php +++ b/tests/EventSubscriberTest.php @@ -27,7 +27,7 @@ class EventSubscriberTest extends TestCase { public function testCanSubscribeToEvents(): void { - $eventSubscriber = new EventSubscriber(new ReportService([])); + $eventSubscriber = new EventSubscriber(new ReportService([]), null); $dispatcher = new EventDispatcher(); $dispatcher->addSubscriber($eventSubscriber); @@ -40,7 +40,7 @@ public function testBeforeScenarioWithNoCoverage(): void { $event = $this->createMock(ScenarioTested::class); - $subscriber = new EventSubscriber(new ReportService([])); + $subscriber = new EventSubscriber(new ReportService([]), null); $subscriber->beforeScenario($event); self::assertTrue(true); @@ -50,7 +50,7 @@ public function testAfterScenarioWithNoCoverage(): void { $event = $this->createMock(ScenarioTested::class); - $subscriber = new EventSubscriber(new ReportService([])); + $subscriber = new EventSubscriber(new ReportService([]), null); $subscriber->afterScenario($event); self::assertTrue(true); @@ -60,7 +60,7 @@ public function testAfterExerciseWithNoCoverage(): void { $event = $this->createMock(ExerciseCompleted::class); - $subscriber = new EventSubscriber(new ReportService([])); + $subscriber = new EventSubscriber(new ReportService([]), null); $subscriber->afterExercise($event); self::assertTrue(true);