Skip to content

Commit

Permalink
Merge pull request #385 from eliashaeussler/feature/0.8.x/php-8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
eliashaeussler authored Jul 16, 2024
2 parents 9a01813 + ddc2663 commit 9ff5860
Show file tree
Hide file tree
Showing 32 changed files with 48 additions and 48 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions bin/cache-warmup
Original file line number Diff line number Diff line change
Expand Up @@ -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 <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down Expand Up @@ -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();
12 changes: 6 additions & 6 deletions box.json
Original file line number Diff line number Diff line change
@@ -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"
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*",
Expand Down
6 changes: 3 additions & 3 deletions src/CacheWarmer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Command/CacheWarmupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down
2 changes: 1 addition & 1 deletion src/Crawler/AbstractConfigurableCrawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down
2 changes: 1 addition & 1 deletion src/Crawler/ConcurrentCrawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down
2 changes: 1 addition & 1 deletion src/Crawler/ConfigurableCrawlerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down
2 changes: 1 addition & 1 deletion src/Crawler/CrawlerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down
2 changes: 1 addition & 1 deletion src/Crawler/OutputtingCrawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down
2 changes: 1 addition & 1 deletion src/Crawler/VerboseCrawlerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down
2 changes: 1 addition & 1 deletion src/CrawlingState.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/InvalidCrawlerOptionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/MissingArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down
2 changes: 1 addition & 1 deletion src/Sitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down
4 changes: 2 additions & 2 deletions src/Xml/XmlParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions tests/Build/console-application.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand All @@ -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;
2 changes: 1 addition & 1 deletion tests/Unit/CacheWarmerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Command/CacheWarmupCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down Expand Up @@ -382,7 +382,7 @@ public function executeUsesCrawlerOptionsDataProvider(): Generator
}

/**
* @return \Generator<string, array{bool, int}>
* @return Generator<string, array{bool, int}>
*/
public function executeFailsIfSitemapCannotBeCrawledDataProvider(): Generator
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Crawler/AbstractConfigurableCrawlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Crawler/ConcurrentCrawlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Crawler/DummyConfigurableCrawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Crawler/DummyCrawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Crawler/DummyVerboseCrawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Crawler/OutputtingCrawlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/CrawlerResultProcessorTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/CrawlingStateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Exception/InvalidCrawlerOptionExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/RequestProphecyTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/SitemapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Xml/XmlParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
* This file is part of the Composer package "eliashaeussler/cache-warmup".
*
* Copyright (C) 2023 Elias Häußler <elias@haeussler.dev>
* Copyright (C) 2024 Elias Häußler <elias@haeussler.dev>
*
* 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
Expand Down

0 comments on commit 9ff5860

Please sign in to comment.