diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index c28bbaf5..a80e2eaa 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: ["7.3", "7.4", "8.0", "8.1", "8.2"] + php-version: ["7.3", "7.4", "8.0", "8.1", "8.2", "8.3"] dependencies: ["highest", "lowest"] steps: - uses: actions/checkout@v3 @@ -52,7 +52,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.1 + php-version: 8.3 tools: composer:v2 coverage: pcov diff --git a/bin/cache-warmup b/bin/cache-warmup index 9d9568d4..d51f7ad4 100755 --- a/bin/cache-warmup +++ b/bin/cache-warmup @@ -6,7 +6,7 @@ declare(strict_types=1); /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,8 +41,8 @@ require $autoloadFile; unset($autoloadFile, $file); // Run application -$command = new \EliasHaeussler\CacheWarmup\Command\CacheWarmupCommand(); -$application = new \Symfony\Component\Console\Application('Cache Warmup'); +$command = new EliasHaeussler\CacheWarmup\Command\CacheWarmupCommand(); +$application = new Symfony\Component\Console\Application('Cache Warmup'); $application->add($command); $application->setDefaultCommand('cache-warmup', true); $application->run(); diff --git a/box.json b/box.json index 1b6de1ab..5126206f 100644 --- a/box.json +++ b/box.json @@ -1,8 +1,8 @@ { - "compactors": [ - "KevinGH\\Box\\Compactor\\Json", - "KevinGH\\Box\\Compactor\\Php" - ], - "compression": "GZ", - "output": ".build/cache-warmup.phar" + "compactors": [ + "KevinGH\\Box\\Compactor\\Json", + "KevinGH\\Box\\Compactor\\Php" + ], + "compression": "GZ", + "output": ".build/cache-warmup.phar" } diff --git a/composer.json b/composer.json index 5d3cd31b..04826d21 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ ], "homepage": "https://haeussler.dev", "require": { - "php": ">= 7.1 < 8.3", + "php": ">= 7.1 < 8.4", "ext-filter": "*", "ext-json": "*", "ext-libxml": "*", diff --git a/src/CacheWarmer.php b/src/CacheWarmer.php index 67bdd9c9..a3f9790b 100644 --- a/src/CacheWarmer.php +++ b/src/CacheWarmer.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -69,14 +69,14 @@ final class CacheWarmer /** * @param string[]|Sitemap[]|string|Sitemap|null $sitemaps */ - public function __construct($sitemaps = null, int $limit = 0, ClientInterface $client = null) + public function __construct($sitemaps = null, int $limit = 0, ?ClientInterface $client = null) { $this->limit = $limit; $this->client = $client ?? new Client(); $this->addSitemaps($sitemaps); } - public function run(CrawlerInterface $crawler = null): CrawlerInterface + public function run(?CrawlerInterface $crawler = null): CrawlerInterface { $crawler = $crawler ?? new ConcurrentCrawler(); $crawler->crawl($this->urls); diff --git a/src/Command/CacheWarmupCommand.php b/src/Command/CacheWarmupCommand.php index 3395fd25..3c32506e 100644 --- a/src/Command/CacheWarmupCommand.php +++ b/src/Command/CacheWarmupCommand.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/Crawler/AbstractConfigurableCrawler.php b/src/Crawler/AbstractConfigurableCrawler.php index 8f9aeedb..f9b5899c 100644 --- a/src/Crawler/AbstractConfigurableCrawler.php +++ b/src/Crawler/AbstractConfigurableCrawler.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/Crawler/ConcurrentCrawler.php b/src/Crawler/ConcurrentCrawler.php index 7dd449ec..03542664 100644 --- a/src/Crawler/ConcurrentCrawler.php +++ b/src/Crawler/ConcurrentCrawler.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/Crawler/ConfigurableCrawlerInterface.php b/src/Crawler/ConfigurableCrawlerInterface.php index 3305b796..2fa11d56 100644 --- a/src/Crawler/ConfigurableCrawlerInterface.php +++ b/src/Crawler/ConfigurableCrawlerInterface.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/Crawler/CrawlerInterface.php b/src/Crawler/CrawlerInterface.php index e3b9385d..ebb8c12c 100644 --- a/src/Crawler/CrawlerInterface.php +++ b/src/Crawler/CrawlerInterface.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/Crawler/OutputtingCrawler.php b/src/Crawler/OutputtingCrawler.php index 79003632..a981bade 100644 --- a/src/Crawler/OutputtingCrawler.php +++ b/src/Crawler/OutputtingCrawler.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/Crawler/VerboseCrawlerInterface.php b/src/Crawler/VerboseCrawlerInterface.php index 89557869..5d18d74d 100644 --- a/src/Crawler/VerboseCrawlerInterface.php +++ b/src/Crawler/VerboseCrawlerInterface.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/CrawlingState.php b/src/CrawlingState.php index c66339d0..7b72925c 100644 --- a/src/CrawlingState.php +++ b/src/CrawlingState.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/Exception/InvalidCrawlerOptionException.php b/src/Exception/InvalidCrawlerOptionException.php index e15855e1..ce5fd79f 100644 --- a/src/Exception/InvalidCrawlerOptionException.php +++ b/src/Exception/InvalidCrawlerOptionException.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/Exception/MissingArgumentException.php b/src/Exception/MissingArgumentException.php index 5fab4b3f..f661476e 100644 --- a/src/Exception/MissingArgumentException.php +++ b/src/Exception/MissingArgumentException.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/Sitemap.php b/src/Sitemap.php index 87f9d28e..ec111e5f 100644 --- a/src/Sitemap.php +++ b/src/Sitemap.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/Xml/XmlParser.php b/src/Xml/XmlParser.php index 3dbd7781..34d202db 100644 --- a/src/Xml/XmlParser.php +++ b/src/Xml/XmlParser.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -62,7 +62,7 @@ final class XmlParser */ private $parsedUrls = []; - public function __construct(Sitemap $sitemap, ClientInterface $client = null) + public function __construct(Sitemap $sitemap, ?ClientInterface $client = null) { $this->sitemap = $sitemap; $this->client = $client ?? new Client(); diff --git a/tests/Build/console-application.php b/tests/Build/console-application.php index 70ab9c5b..a4ff5863 100644 --- a/tests/Build/console-application.php +++ b/tests/Build/console-application.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,7 +23,7 @@ require_once __DIR__.'/../../vendor/autoload.php'; -$application = new \Symfony\Component\Console\Application(); -$application->add(new \EliasHaeussler\CacheWarmup\Command\CacheWarmupCommand()); +$application = new Symfony\Component\Console\Application(); +$application->add(new EliasHaeussler\CacheWarmup\Command\CacheWarmupCommand()); return $application; diff --git a/tests/Unit/CacheWarmerTest.php b/tests/Unit/CacheWarmerTest.php index 828bc325..2b5c80e3 100644 --- a/tests/Unit/CacheWarmerTest.php +++ b/tests/Unit/CacheWarmerTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/tests/Unit/Command/CacheWarmupCommandTest.php b/tests/Unit/Command/CacheWarmupCommandTest.php index 92788f2a..86dc2538 100644 --- a/tests/Unit/Command/CacheWarmupCommandTest.php +++ b/tests/Unit/Command/CacheWarmupCommandTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -382,7 +382,7 @@ public function executeUsesCrawlerOptionsDataProvider(): Generator } /** - * @return \Generator + * @return Generator */ public function executeFailsIfSitemapCannotBeCrawledDataProvider(): Generator { diff --git a/tests/Unit/Crawler/AbstractConfigurableCrawlerTest.php b/tests/Unit/Crawler/AbstractConfigurableCrawlerTest.php index c815fcd0..7d4c9327 100644 --- a/tests/Unit/Crawler/AbstractConfigurableCrawlerTest.php +++ b/tests/Unit/Crawler/AbstractConfigurableCrawlerTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/tests/Unit/Crawler/ConcurrentCrawlerTest.php b/tests/Unit/Crawler/ConcurrentCrawlerTest.php index ac4821d1..04997088 100644 --- a/tests/Unit/Crawler/ConcurrentCrawlerTest.php +++ b/tests/Unit/Crawler/ConcurrentCrawlerTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/tests/Unit/Crawler/DummyConfigurableCrawler.php b/tests/Unit/Crawler/DummyConfigurableCrawler.php index cb75048b..c81dc92f 100644 --- a/tests/Unit/Crawler/DummyConfigurableCrawler.php +++ b/tests/Unit/Crawler/DummyConfigurableCrawler.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/tests/Unit/Crawler/DummyCrawler.php b/tests/Unit/Crawler/DummyCrawler.php index 443d426d..3ea784db 100644 --- a/tests/Unit/Crawler/DummyCrawler.php +++ b/tests/Unit/Crawler/DummyCrawler.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/tests/Unit/Crawler/DummyVerboseCrawler.php b/tests/Unit/Crawler/DummyVerboseCrawler.php index da294fc9..98686ab9 100644 --- a/tests/Unit/Crawler/DummyVerboseCrawler.php +++ b/tests/Unit/Crawler/DummyVerboseCrawler.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/tests/Unit/Crawler/OutputtingCrawlerTest.php b/tests/Unit/Crawler/OutputtingCrawlerTest.php index df9aa504..0e493257 100644 --- a/tests/Unit/Crawler/OutputtingCrawlerTest.php +++ b/tests/Unit/Crawler/OutputtingCrawlerTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/tests/Unit/CrawlerResultProcessorTrait.php b/tests/Unit/CrawlerResultProcessorTrait.php index d7229a10..caf5b92e 100644 --- a/tests/Unit/CrawlerResultProcessorTrait.php +++ b/tests/Unit/CrawlerResultProcessorTrait.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -38,7 +38,7 @@ trait CrawlerResultProcessorTrait /** * @return UriInterface[] */ - protected function getProcessedUrlsFromCrawler(CrawlerInterface $crawler, int $state = null): array + protected function getProcessedUrlsFromCrawler(CrawlerInterface $crawler, ?int $state = null): array { $urls = []; $crawledUrls = array_merge($crawler->getSuccessfulUrls(), $crawler->getFailedUrls()); diff --git a/tests/Unit/CrawlingStateTest.php b/tests/Unit/CrawlingStateTest.php index b8c09f07..3977167a 100644 --- a/tests/Unit/CrawlingStateTest.php +++ b/tests/Unit/CrawlingStateTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/tests/Unit/Exception/InvalidCrawlerOptionExceptionTest.php b/tests/Unit/Exception/InvalidCrawlerOptionExceptionTest.php index 4e0e4817..8da27496 100644 --- a/tests/Unit/Exception/InvalidCrawlerOptionExceptionTest.php +++ b/tests/Unit/Exception/InvalidCrawlerOptionExceptionTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/tests/Unit/RequestProphecyTrait.php b/tests/Unit/RequestProphecyTrait.php index d24db80a..8aef9b33 100644 --- a/tests/Unit/RequestProphecyTrait.php +++ b/tests/Unit/RequestProphecyTrait.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -55,7 +55,7 @@ trait RequestProphecyTrait /** * @throws ClientExceptionInterface */ - protected function prophesizeSitemapRequest(string $fixture, UriInterface $expectedUri = null): void + protected function prophesizeSitemapRequest(string $fixture, ?UriInterface $expectedUri = null): void { $absolutePath = 'Fixtures/'.$fixture.'.xml'; $fixtureFile = realpath(__DIR__.'/'.$absolutePath); diff --git a/tests/Unit/SitemapTest.php b/tests/Unit/SitemapTest.php index 4a525a8f..9fadffd8 100644 --- a/tests/Unit/SitemapTest.php +++ b/tests/Unit/SitemapTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/tests/Unit/Xml/XmlParserTest.php b/tests/Unit/Xml/XmlParserTest.php index e2ee9798..d033b67a 100644 --- a/tests/Unit/Xml/XmlParserTest.php +++ b/tests/Unit/Xml/XmlParserTest.php @@ -5,7 +5,7 @@ /* * This file is part of the Composer package "eliashaeussler/cache-warmup". * - * Copyright (C) 2023 Elias Häußler + * Copyright (C) 2024 Elias Häußler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by