diff --git a/composer.json b/composer.json index 37fc0a82..f51bfef1 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "propel/propel1": "^1.6", "psalm/plugin-phpunit": "^0.16", "psalm/plugin-symfony": "^3.0", - "rector/rector": "^0.13", + "rector/rector": "^0.15", "symfony/config": "^4.4 || ^5.4 || ^6.0", "symfony/dependency-injection": "^4.4 || ^5.4 || ^6.0", "symfony/http-foundation": "^4.4 || ^5.4 || ^6.0", diff --git a/src/Writer/InMemoryWriter.php b/src/Writer/InMemoryWriter.php index 1d30c0d6..ef66f6af 100644 --- a/src/Writer/InMemoryWriter.php +++ b/src/Writer/InMemoryWriter.php @@ -18,7 +18,7 @@ final class InMemoryWriter implements WriterInterface /** * @var array */ - private $elements; + private array $elements = []; public function open(): void { diff --git a/src/Writer/SitemapWriter.php b/src/Writer/SitemapWriter.php index 7b90c2b5..f5f33e89 100644 --- a/src/Writer/SitemapWriter.php +++ b/src/Writer/SitemapWriter.php @@ -134,7 +134,7 @@ public function close(): void */ public static function generateSitemapIndex(string $folder, string $baseUrl, string $pattern = 'sitemap*.xml', string $filename = 'sitemap.xml'): void { - $content = "\n\n"; + $content = "\n\n"; foreach (glob(sprintf('%s/%s', $folder, $pattern)) as $file) { $stat = stat($file); $content .= sprintf( @@ -250,7 +250,7 @@ private function fixDataType(array &$data): void */ private function generateDefaultLine(array $data): string { - return sprintf(' '.'%s%s%s%s'."\n", $data['url'], date('Y-m-d', strtotime($data['lastmod'])), $data['changefreq'], $data['priority']); + return sprintf(' %s%s%s%s'."\n", $data['url'], date('Y-m-d', strtotime($data['lastmod'])), $data['changefreq'], $data['priority']); } /** @@ -281,7 +281,7 @@ private function generateImageLine(array $data): string $images .= ''; } - return sprintf(' '.'%s%s'."\n", $data['url'], $images); + return sprintf(' %s%s'."\n", $data['url'], $images); } /** @@ -300,7 +300,7 @@ private function generateVideoLine(array $data): string $videos .= sprintf('%2$s', $builder[$key] ?? $key, $video); } - return sprintf(' '.'%s%s'."\n", $data['url'], $videos); + return sprintf(' %s%s'."\n", $data['url'], $videos); } /** diff --git a/tests/Source/DoctrineODMQuerySourceIteratorTest.php b/tests/Source/DoctrineODMQuerySourceIteratorTest.php index a00a39d9..a52e168c 100644 --- a/tests/Source/DoctrineODMQuerySourceIteratorTest.php +++ b/tests/Source/DoctrineODMQuerySourceIteratorTest.php @@ -85,7 +85,7 @@ private function createConfiguration(): Configuration $config->setHydratorNamespace('Hydrators'); $config->setPersistentCollectionDir($directory); $config->setPersistentCollectionNamespace('PersistentCollections'); - $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver()); // @phpstan-ignore-line + $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver()); return $config; } diff --git a/tests/Source/IteratorSourceIteratorTest.php b/tests/Source/IteratorSourceIteratorTest.php index 4a1be3a7..5b5e12cf 100644 --- a/tests/Source/IteratorSourceIteratorTest.php +++ b/tests/Source/IteratorSourceIteratorTest.php @@ -24,7 +24,7 @@ final class IteratorSourceIteratorTest extends TestCase /** * @var \Iterator&MockObject */ - private $iterator; + private \Iterator $iterator; protected function setUp(): void {