Skip to content

Commit

Permalink
[TASK] Run PHP-CS-Fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
eliashaeussler committed Jul 16, 2024
1 parent 8bff76b commit ddc2663
Show file tree
Hide file tree
Showing 29 changed files with 39 additions and 39 deletions.
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();
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 ddc2663

Please sign in to comment.