From 296be93025405ae98fc5c803bdc8b2dc8638a85a Mon Sep 17 00:00:00 2001 From: Romain Monteil Date: Fri, 10 Jan 2025 11:30:15 +0100 Subject: [PATCH] Add Symfony 7.2 and PHP 8.4 to test matrix, add typing, fix deprecations and remove superfluous docblock (#351) --- .github/workflows/tests.yml | 20 +++++++++---------- phpstan-baseline.neon | 5 +++++ src/Event/SitemapPopulateEvent.php | 2 +- src/Messenger/DumpSitemapMessage.php | 6 +++--- src/Service/AbstractGenerator.php | 6 +++--- src/Service/Dumper.php | 6 +++--- src/Service/DumperInterface.php | 2 +- src/Service/Generator.php | 4 ++-- src/Sitemap/Url/GoogleImage.php | 8 ++++---- .../Url/GoogleMultilangUrlDecorator.php | 4 ++-- src/Sitemap/Url/GoogleVideo.php | 4 ++-- src/Sitemap/Url/UrlConcrete.php | 6 +++--- src/Sitemap/Urlset.php | 2 +- tests/Integration/config/6.1/framework.yaml | 14 ------------- .../config/6.1/routes/controllers.yaml | 3 --- tests/Integration/config/6.3/framework.yaml | 14 ------------- tests/Integration/config/6.3/messenger.yaml | 6 ------ .../config/6.3/presta_sitemap.yaml | 9 --------- .../config/6.3/routes/controllers.yaml | 3 --- .../config/6.3/routes/presta_sitemap.yaml | 2 -- .../config/6.3/routes/translated.yaml | 7 ------- tests/Integration/config/6.3/routes/xml.xml | 14 ------------- tests/Integration/config/6.3/routes/yaml.yaml | 6 ------ tests/Integration/config/7.1/messenger.yaml | 6 ------ .../config/7.1/presta_sitemap.yaml | 9 --------- .../config/7.1/routes/presta_sitemap.yaml | 2 -- .../config/7.1/routes/translated.yaml | 7 ------- tests/Integration/config/7.1/routes/xml.xml | 14 ------------- tests/Integration/config/7.1/routes/yaml.yaml | 6 ------ .../config/{7.1 => 7.2}/framework.yaml | 0 .../config/{6.1 => 7.2}/messenger.yaml | 0 .../config/{6.1 => 7.2}/presta_sitemap.yaml | 0 .../{7.1 => 7.2}/routes/controllers.yaml | 0 .../{6.1 => 7.2}/routes/presta_sitemap.yaml | 0 .../{6.1 => 7.2}/routes/translated.yaml | 0 .../config/{6.1 => 7.2}/routes/xml.xml | 0 .../config/{6.1 => 7.2}/routes/yaml.yaml | 0 .../Unit/Command/DumpSitemapsCommandTest.php | 2 +- tests/Unit/Sitemap/Url/GoogleImageTest.php | 6 +++--- .../Url/GoogleNewsUrlDecoratorTest.php | 4 ++-- 40 files changed, 46 insertions(+), 163 deletions(-) delete mode 100644 tests/Integration/config/6.1/framework.yaml delete mode 100644 tests/Integration/config/6.1/routes/controllers.yaml delete mode 100644 tests/Integration/config/6.3/framework.yaml delete mode 100644 tests/Integration/config/6.3/messenger.yaml delete mode 100644 tests/Integration/config/6.3/presta_sitemap.yaml delete mode 100644 tests/Integration/config/6.3/routes/controllers.yaml delete mode 100644 tests/Integration/config/6.3/routes/presta_sitemap.yaml delete mode 100644 tests/Integration/config/6.3/routes/translated.yaml delete mode 100644 tests/Integration/config/6.3/routes/xml.xml delete mode 100644 tests/Integration/config/6.3/routes/yaml.yaml delete mode 100644 tests/Integration/config/7.1/messenger.yaml delete mode 100644 tests/Integration/config/7.1/presta_sitemap.yaml delete mode 100644 tests/Integration/config/7.1/routes/presta_sitemap.yaml delete mode 100644 tests/Integration/config/7.1/routes/translated.yaml delete mode 100644 tests/Integration/config/7.1/routes/xml.xml delete mode 100644 tests/Integration/config/7.1/routes/yaml.yaml rename tests/Integration/config/{7.1 => 7.2}/framework.yaml (100%) rename tests/Integration/config/{6.1 => 7.2}/messenger.yaml (100%) rename tests/Integration/config/{6.1 => 7.2}/presta_sitemap.yaml (100%) rename tests/Integration/config/{7.1 => 7.2}/routes/controllers.yaml (100%) rename tests/Integration/config/{6.1 => 7.2}/routes/presta_sitemap.yaml (100%) rename tests/Integration/config/{6.1 => 7.2}/routes/translated.yaml (100%) rename tests/Integration/config/{6.1 => 7.2}/routes/xml.xml (100%) rename tests/Integration/config/{6.1 => 7.2}/routes/yaml.yaml (100%) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b39a6266..ae1f00ed 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,12 +24,12 @@ jobs: symfony-version: 5.4.* - php-version: 8.1 symfony-version: 6.4.* - - php-version: 8.3 + - php-version: 8.4 symfony-version: 6.4.* - php-version: 8.2 - symfony-version: 7.1.* - - php-version: 8.3 - symfony-version: 7.1.* + symfony-version: 7.2.* + - php-version: 8.4 + symfony-version: 7.2.* steps: - name: "Checkout" @@ -61,8 +61,8 @@ jobs: strategy: matrix: include: - - php-version: 8.3 - symfony-version: 7.1.* + - php-version: 8.4 + symfony-version: 7.2.* steps: - name: "Checkout" @@ -100,8 +100,8 @@ jobs: strategy: matrix: include: - - php-version: 8.3 - symfony-version: 7.1.* + - php-version: 8.4 + symfony-version: 7.2.* steps: - name: "Checkout" @@ -133,8 +133,8 @@ jobs: strategy: matrix: include: - - php-version: 8.3 - symfony-version: 7.1.* + - php-version: 8.4 + symfony-version: 7.2.* steps: - name: "Checkout" diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 535259ca..9f1071df 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,5 +1,10 @@ parameters: ignoreErrors: + - + message: "#^Offset 1 does not exist on array\\{0\\?\\: string, 1\\?\\: non\\-empty\\-string, 2\\?\\: '\\.gz'\\}\\.$#" + count: 1 + path: src/Service/Dumper.php + - message: "#^Offset 'uri' on array\\{timed_out\\: bool, blocked\\: bool, eof\\: bool, unread_bytes\\: int, stream_type\\: string, wrapper_type\\: string, wrapper_data\\: mixed, mode\\: string, \\.\\.\\.\\} in isset\\(\\) always exists and is not nullable\\.$#" count: 1 diff --git a/src/Event/SitemapPopulateEvent.php b/src/Event/SitemapPopulateEvent.php index a55ab6d3..3ddef295 100644 --- a/src/Event/SitemapPopulateEvent.php +++ b/src/Event/SitemapPopulateEvent.php @@ -47,7 +47,7 @@ class SitemapPopulateEvent extends Event public function __construct( UrlContainerInterface $urlContainer, UrlGeneratorInterface $urlGenerator, - string $section = null + ?string $section = null ) { $this->urlContainer = $urlContainer; $this->section = $section; diff --git a/src/Messenger/DumpSitemapMessage.php b/src/Messenger/DumpSitemapMessage.php index 7b045e66..08f286e2 100644 --- a/src/Messenger/DumpSitemapMessage.php +++ b/src/Messenger/DumpSitemapMessage.php @@ -43,9 +43,9 @@ class DumpSitemapMessage * @param array $options */ public function __construct( - string $section = null, - string $baseUrl = null, - string $targetDir = null, + ?string $section = null, + ?string $baseUrl = null, + ?string $targetDir = null, array $options = [] ) { $this->section = $section; diff --git a/src/Service/AbstractGenerator.php b/src/Service/AbstractGenerator.php index 34d5d38c..ac6c4e0f 100644 --- a/src/Service/AbstractGenerator.php +++ b/src/Service/AbstractGenerator.php @@ -65,7 +65,7 @@ abstract class AbstractGenerator implements UrlContainerInterface public function __construct( EventDispatcherInterface $dispatcher, UrlGeneratorInterface $urlGenerator, - int $itemsBySet = null + ?int $itemsBySet = null ) { $this->dispatcher = $dispatcher; // We add one to LIMIT_ITEMS because it was used as an index, not a quantity @@ -146,14 +146,14 @@ public function getUrlset(string $name): Urlset * * @return Urlset */ - abstract protected function newUrlset(string $name, \DateTimeInterface $lastmod = null): Urlset; + abstract protected function newUrlset(string $name, ?\DateTimeInterface $lastmod = null): Urlset; /** * Dispatches SitemapPopulate Event - the listeners should use it to add their URLs to the sitemap * * @param string|null $section */ - protected function populate(string $section = null): void + protected function populate(?string $section = null): void { $event = new SitemapPopulateEvent($this, $this->urlGenerator, $section); diff --git a/src/Service/Dumper.php b/src/Service/Dumper.php index 51b237f2..98e21906 100644 --- a/src/Service/Dumper.php +++ b/src/Service/Dumper.php @@ -58,7 +58,7 @@ public function __construct( Filesystem $filesystem, UrlGeneratorInterface $urlGenerator, string $sitemapFilePrefix = Configuration::DEFAULT_FILENAME, - int $itemsBySet = null + ?int $itemsBySet = null ) { parent::__construct($dispatcher, $urlGenerator, $itemsBySet); @@ -69,7 +69,7 @@ public function __construct( /** * @inheritdoc */ - public function dump(string $targetDir, string $host, string $section = null, array $options = []) + public function dump(string $targetDir, string $host, ?string $section = null, array $options = []) { /** @var array{gzip: bool} $options */ $options = array_merge(['gzip' => false], $options); @@ -262,7 +262,7 @@ protected function deleteExistingSitemaps(string $targetDir): void * * @return DumpingUrlset|Urlset */ - protected function newUrlset(string $name, \DateTimeInterface $lastmod = null, bool $gzExtension = false): Urlset + protected function newUrlset(string $name, ?\DateTimeInterface $lastmod = null, bool $gzExtension = false): Urlset { $url = $this->baseUrl . $this->sitemapFilePrefix . '.' . $name . '.xml'; if ($gzExtension) { diff --git a/src/Service/DumperInterface.php b/src/Service/DumperInterface.php index c1fd608b..cde14647 100644 --- a/src/Service/DumperInterface.php +++ b/src/Service/DumperInterface.php @@ -26,5 +26,5 @@ interface DumperInterface extends UrlContainerInterface * * @return array|bool */ - public function dump(string $targetDir, string $host, string $section = null, array $options = []); + public function dump(string $targetDir, string $host, ?string $section = null, array $options = []); } diff --git a/src/Service/Generator.php b/src/Service/Generator.php index 0fe91634..8f88a5a7 100644 --- a/src/Service/Generator.php +++ b/src/Service/Generator.php @@ -34,7 +34,7 @@ class Generator extends AbstractGenerator implements GeneratorInterface public function __construct( EventDispatcherInterface $dispatcher, UrlGeneratorInterface $router, - int $itemsBySet = null + ?int $itemsBySet = null ) { parent::__construct($dispatcher, $router, $itemsBySet); @@ -65,7 +65,7 @@ public function fetch(string $name): ?XmlConstraint /** * @inheritdoc */ - protected function newUrlset(string $name, \DateTimeInterface $lastmod = null): Urlset + protected function newUrlset(string $name, ?\DateTimeInterface $lastmod = null): Urlset { return new Urlset( $this->router->generate( diff --git a/src/Sitemap/Url/GoogleImage.php b/src/Sitemap/Url/GoogleImage.php index 42eab61d..75360c5d 100644 --- a/src/Sitemap/Url/GoogleImage.php +++ b/src/Sitemap/Url/GoogleImage.php @@ -56,10 +56,10 @@ class GoogleImage */ public function __construct( string $location, - string $caption = null, - string $geoLocation = null, - string $title = null, - string $license = null + ?string $caption = null, + ?string $geoLocation = null, + ?string $title = null, + ?string $license = null ) { $this->setLocation($location); $this->setCaption($caption); diff --git a/src/Sitemap/Url/GoogleMultilangUrlDecorator.php b/src/Sitemap/Url/GoogleMultilangUrlDecorator.php index c30e4016..18218798 100644 --- a/src/Sitemap/Url/GoogleMultilangUrlDecorator.php +++ b/src/Sitemap/Url/GoogleMultilangUrlDecorator.php @@ -43,7 +43,7 @@ class GoogleMultilangUrlDecorator extends UrlDecorator * * @return GoogleMultilangUrlDecorator */ - public function addLink(string $href, string $hreflang, string $rel = null): self + public function addLink(string $href, string $hreflang, ?string $rel = null): self { $this->linkXml .= $this->generateLinkXml($href, $hreflang, $rel); @@ -57,7 +57,7 @@ public function addLink(string $href, string $hreflang, string $rel = null): sel * * @return string */ - protected function generateLinkXml(string $href, string $hreflang, string $rel = null): string + protected function generateLinkXml(string $href, string $hreflang, ?string $rel = null): string { if (null == $rel) { $rel = self::REL_ALTERNATE; diff --git a/src/Sitemap/Url/GoogleVideo.php b/src/Sitemap/Url/GoogleVideo.php index b1f456d4..58b156ba 100644 --- a/src/Sitemap/Url/GoogleVideo.php +++ b/src/Sitemap/Url/GoogleVideo.php @@ -528,7 +528,7 @@ public function setPublicationDate(DateTimeInterface $publicationDate): self * * @return GoogleVideo */ - public function setFamilyFriendly(string $familyFriendly = null): self + public function setFamilyFriendly(?string $familyFriendly = null): self { if (null == $familyFriendly) { $familyFriendly = self::FAMILY_FRIENDLY_YES; @@ -881,7 +881,7 @@ public function getLive(): ?string * * @return GoogleVideo */ - public function addPrice($amount, string $currency, string $type = null, string $resolution = null): self + public function addPrice($amount, string $currency, ?string $type = null, ?string $resolution = null): self { $this->prices[] = [ 'amount' => $amount, diff --git a/src/Sitemap/Url/UrlConcrete.php b/src/Sitemap/Url/UrlConcrete.php index 5e07c4ae..38ac1e53 100644 --- a/src/Sitemap/Url/UrlConcrete.php +++ b/src/Sitemap/Url/UrlConcrete.php @@ -59,8 +59,8 @@ class UrlConcrete implements Url */ public function __construct( string $loc, - DateTimeInterface $lastmod = null, - string $changefreq = null, + ?DateTimeInterface $lastmod = null, + ?string $changefreq = null, $priority = null ) { $this->setLoc($loc); @@ -116,7 +116,7 @@ public function getLastmod(): ?DateTimeInterface * * @return UrlConcrete */ - public function setChangefreq(string $changefreq = null): self + public function setChangefreq(?string $changefreq = null): self { $frequencies = [ self::CHANGEFREQ_ALWAYS, diff --git a/src/Sitemap/Urlset.php b/src/Sitemap/Urlset.php index 7d2780c1..dec642d1 100644 --- a/src/Sitemap/Urlset.php +++ b/src/Sitemap/Urlset.php @@ -48,7 +48,7 @@ class Urlset extends XmlConstraint * @param string $loc * @param DateTimeInterface|null $lastmod */ - public function __construct(string $loc, DateTimeInterface $lastmod = null) + public function __construct(string $loc, ?DateTimeInterface $lastmod = null) { $this->loc = $loc; $this->lastmod = $lastmod ?? new \DateTimeImmutable(); diff --git a/tests/Integration/config/6.1/framework.yaml b/tests/Integration/config/6.1/framework.yaml deleted file mode 100644 index 6177679e..00000000 --- a/tests/Integration/config/6.1/framework.yaml +++ /dev/null @@ -1,14 +0,0 @@ -framework: - test: true - secret: '%env(APP_SECRET)%' - http_method_override: false - session: - handler_id: null - cookie_secure: auto - cookie_samesite: lax - storage_factory_id: session.storage.factory.mock_file - php_errors: - log: true - router: - utf8: true - cache: null diff --git a/tests/Integration/config/6.1/routes/controllers.yaml b/tests/Integration/config/6.1/routes/controllers.yaml deleted file mode 100644 index 0d66ff66..00000000 --- a/tests/Integration/config/6.1/routes/controllers.yaml +++ /dev/null @@ -1,3 +0,0 @@ -controllers: - resource: ../../../src/Controller/ - type: annotation diff --git a/tests/Integration/config/6.3/framework.yaml b/tests/Integration/config/6.3/framework.yaml deleted file mode 100644 index 6177679e..00000000 --- a/tests/Integration/config/6.3/framework.yaml +++ /dev/null @@ -1,14 +0,0 @@ -framework: - test: true - secret: '%env(APP_SECRET)%' - http_method_override: false - session: - handler_id: null - cookie_secure: auto - cookie_samesite: lax - storage_factory_id: session.storage.factory.mock_file - php_errors: - log: true - router: - utf8: true - cache: null diff --git a/tests/Integration/config/6.3/messenger.yaml b/tests/Integration/config/6.3/messenger.yaml deleted file mode 100644 index 715b4f76..00000000 --- a/tests/Integration/config/6.3/messenger.yaml +++ /dev/null @@ -1,6 +0,0 @@ -framework: - messenger: - transports: - async: 'in-memory://' - routing: - 'Presta\SitemapBundle\Messenger\DumpSitemapMessage': async diff --git a/tests/Integration/config/6.3/presta_sitemap.yaml b/tests/Integration/config/6.3/presta_sitemap.yaml deleted file mode 100644 index f548ca09..00000000 --- a/tests/Integration/config/6.3/presta_sitemap.yaml +++ /dev/null @@ -1,9 +0,0 @@ -presta_sitemap: - default_section: static - dump_directory: "%kernel.project_dir%/public" - items_by_set: 10 - alternate: - enabled: true - default_locale: en - locales: [en, fr] - i18n: symfony diff --git a/tests/Integration/config/6.3/routes/controllers.yaml b/tests/Integration/config/6.3/routes/controllers.yaml deleted file mode 100644 index 0d66ff66..00000000 --- a/tests/Integration/config/6.3/routes/controllers.yaml +++ /dev/null @@ -1,3 +0,0 @@ -controllers: - resource: ../../../src/Controller/ - type: annotation diff --git a/tests/Integration/config/6.3/routes/presta_sitemap.yaml b/tests/Integration/config/6.3/routes/presta_sitemap.yaml deleted file mode 100644 index f0391692..00000000 --- a/tests/Integration/config/6.3/routes/presta_sitemap.yaml +++ /dev/null @@ -1,2 +0,0 @@ -presta_sitemap: - resource: "@PrestaSitemapBundle/config/routing.yml" diff --git a/tests/Integration/config/6.3/routes/translated.yaml b/tests/Integration/config/6.3/routes/translated.yaml deleted file mode 100644 index ada2f3d2..00000000 --- a/tests/Integration/config/6.3/routes/translated.yaml +++ /dev/null @@ -1,7 +0,0 @@ -about: - path: - en: /about - fr: /a-propos - defaults: { _controller: \Presta\SitemapBundle\Tests\Integration\Controller\StaticController::about } - options: - sitemap: true diff --git a/tests/Integration/config/6.3/routes/xml.xml b/tests/Integration/config/6.3/routes/xml.xml deleted file mode 100644 index 826980b4..00000000 --- a/tests/Integration/config/6.3/routes/xml.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - Presta\SitemapBundle\Tests\Integration\Controller\StaticController::company - - - - diff --git a/tests/Integration/config/6.3/routes/yaml.yaml b/tests/Integration/config/6.3/routes/yaml.yaml deleted file mode 100644 index 5e24a5f1..00000000 --- a/tests/Integration/config/6.3/routes/yaml.yaml +++ /dev/null @@ -1,6 +0,0 @@ -yaml: - path: /contact - defaults: { _controller: \Presta\SitemapBundle\Tests\Integration\Controller\StaticController::contact } - options: - sitemap: - section: static diff --git a/tests/Integration/config/7.1/messenger.yaml b/tests/Integration/config/7.1/messenger.yaml deleted file mode 100644 index 715b4f76..00000000 --- a/tests/Integration/config/7.1/messenger.yaml +++ /dev/null @@ -1,6 +0,0 @@ -framework: - messenger: - transports: - async: 'in-memory://' - routing: - 'Presta\SitemapBundle\Messenger\DumpSitemapMessage': async diff --git a/tests/Integration/config/7.1/presta_sitemap.yaml b/tests/Integration/config/7.1/presta_sitemap.yaml deleted file mode 100644 index f548ca09..00000000 --- a/tests/Integration/config/7.1/presta_sitemap.yaml +++ /dev/null @@ -1,9 +0,0 @@ -presta_sitemap: - default_section: static - dump_directory: "%kernel.project_dir%/public" - items_by_set: 10 - alternate: - enabled: true - default_locale: en - locales: [en, fr] - i18n: symfony diff --git a/tests/Integration/config/7.1/routes/presta_sitemap.yaml b/tests/Integration/config/7.1/routes/presta_sitemap.yaml deleted file mode 100644 index f0391692..00000000 --- a/tests/Integration/config/7.1/routes/presta_sitemap.yaml +++ /dev/null @@ -1,2 +0,0 @@ -presta_sitemap: - resource: "@PrestaSitemapBundle/config/routing.yml" diff --git a/tests/Integration/config/7.1/routes/translated.yaml b/tests/Integration/config/7.1/routes/translated.yaml deleted file mode 100644 index ada2f3d2..00000000 --- a/tests/Integration/config/7.1/routes/translated.yaml +++ /dev/null @@ -1,7 +0,0 @@ -about: - path: - en: /about - fr: /a-propos - defaults: { _controller: \Presta\SitemapBundle\Tests\Integration\Controller\StaticController::about } - options: - sitemap: true diff --git a/tests/Integration/config/7.1/routes/xml.xml b/tests/Integration/config/7.1/routes/xml.xml deleted file mode 100644 index 826980b4..00000000 --- a/tests/Integration/config/7.1/routes/xml.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - Presta\SitemapBundle\Tests\Integration\Controller\StaticController::company - - - - diff --git a/tests/Integration/config/7.1/routes/yaml.yaml b/tests/Integration/config/7.1/routes/yaml.yaml deleted file mode 100644 index 5e24a5f1..00000000 --- a/tests/Integration/config/7.1/routes/yaml.yaml +++ /dev/null @@ -1,6 +0,0 @@ -yaml: - path: /contact - defaults: { _controller: \Presta\SitemapBundle\Tests\Integration\Controller\StaticController::contact } - options: - sitemap: - section: static diff --git a/tests/Integration/config/7.1/framework.yaml b/tests/Integration/config/7.2/framework.yaml similarity index 100% rename from tests/Integration/config/7.1/framework.yaml rename to tests/Integration/config/7.2/framework.yaml diff --git a/tests/Integration/config/6.1/messenger.yaml b/tests/Integration/config/7.2/messenger.yaml similarity index 100% rename from tests/Integration/config/6.1/messenger.yaml rename to tests/Integration/config/7.2/messenger.yaml diff --git a/tests/Integration/config/6.1/presta_sitemap.yaml b/tests/Integration/config/7.2/presta_sitemap.yaml similarity index 100% rename from tests/Integration/config/6.1/presta_sitemap.yaml rename to tests/Integration/config/7.2/presta_sitemap.yaml diff --git a/tests/Integration/config/7.1/routes/controllers.yaml b/tests/Integration/config/7.2/routes/controllers.yaml similarity index 100% rename from tests/Integration/config/7.1/routes/controllers.yaml rename to tests/Integration/config/7.2/routes/controllers.yaml diff --git a/tests/Integration/config/6.1/routes/presta_sitemap.yaml b/tests/Integration/config/7.2/routes/presta_sitemap.yaml similarity index 100% rename from tests/Integration/config/6.1/routes/presta_sitemap.yaml rename to tests/Integration/config/7.2/routes/presta_sitemap.yaml diff --git a/tests/Integration/config/6.1/routes/translated.yaml b/tests/Integration/config/7.2/routes/translated.yaml similarity index 100% rename from tests/Integration/config/6.1/routes/translated.yaml rename to tests/Integration/config/7.2/routes/translated.yaml diff --git a/tests/Integration/config/6.1/routes/xml.xml b/tests/Integration/config/7.2/routes/xml.xml similarity index 100% rename from tests/Integration/config/6.1/routes/xml.xml rename to tests/Integration/config/7.2/routes/xml.xml diff --git a/tests/Integration/config/6.1/routes/yaml.yaml b/tests/Integration/config/7.2/routes/yaml.yaml similarity index 100% rename from tests/Integration/config/6.1/routes/yaml.yaml rename to tests/Integration/config/7.2/routes/yaml.yaml diff --git a/tests/Unit/Command/DumpSitemapsCommandTest.php b/tests/Unit/Command/DumpSitemapsCommandTest.php index fa3f2c30..c886eb99 100644 --- a/tests/Unit/Command/DumpSitemapsCommandTest.php +++ b/tests/Unit/Command/DumpSitemapsCommandTest.php @@ -149,7 +149,7 @@ public function baseUrls(): \Generator yield 'Custom https port' => ['https://host.org:8080', 'https://host.org:8080/']; } - private function executeCommand(?string $section, bool $gzip, string $baseUrl = null): array + private function executeCommand(?string $section, bool $gzip, ?string $baseUrl = null): array { $options = ['target' => self::TARGET_DIR, '--gzip' => $gzip]; if ($section !== null) { diff --git a/tests/Unit/Sitemap/Url/GoogleImageTest.php b/tests/Unit/Sitemap/Url/GoogleImageTest.php index 0e305582..0300e7c0 100644 --- a/tests/Unit/Sitemap/Url/GoogleImageTest.php +++ b/tests/Unit/Sitemap/Url/GoogleImageTest.php @@ -23,9 +23,9 @@ public function testToXml( string $expectedXml, string $location, string $caption, - string $geoLocalisation = null, - string $title = null, - string $license = null + ?string $geoLocalisation = null, + ?string $title = null, + ?string $license = null ): void { $failed = false; try { diff --git a/tests/Unit/Sitemap/Url/GoogleNewsUrlDecoratorTest.php b/tests/Unit/Sitemap/Url/GoogleNewsUrlDecoratorTest.php index 7b84640d..12342ff4 100644 --- a/tests/Unit/Sitemap/Url/GoogleNewsUrlDecoratorTest.php +++ b/tests/Unit/Sitemap/Url/GoogleNewsUrlDecoratorTest.php @@ -227,9 +227,9 @@ public function testToXml( string $language, DateTime $date, string $title, - string $access = null, + ?string $access = null, array $genres = [], - string $geoLocations = null, + ?string $geoLocations = null, array $keywords = [], array $stockTickers = [] ): void {