Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Jan 2, 2023
1 parent 6a00252 commit 17ba149
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/Writer/InMemoryWriter.php
Expand Up @@ -18,7 +18,7 @@ final class InMemoryWriter implements WriterInterface
/**
* @var array<mixed>
*/
private $elements;
private array $elements = [];

public function open(): void
{
Expand Down
8 changes: 4 additions & 4 deletions src/Writer/SitemapWriter.php
Expand Up @@ -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 = "<?xml version='1.0' encoding='UTF-8'?".">\n<sitemapindex xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.sitemaps.org/schemas/sitemap/1.0 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd' xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'>\n";
$content = "<?xml version='1.0' encoding='UTF-8'?>\n<sitemapindex xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.sitemaps.org/schemas/sitemap/1.0 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd' xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'>\n";
foreach (glob(sprintf('%s/%s', $folder, $pattern)) as $file) {
$stat = stat($file);
$content .= sprintf(
Expand Down Expand Up @@ -250,7 +250,7 @@ private function fixDataType(array &$data): void
*/
private function generateDefaultLine(array $data): string
{
return sprintf(' '.'<url><loc>%s</loc><lastmod>%s</lastmod><changefreq>%s</changefreq><priority>%s</priority></url>'."\n", $data['url'], date('Y-m-d', strtotime($data['lastmod'])), $data['changefreq'], $data['priority']);
return sprintf(' <url><loc>%s</loc><lastmod>%s</lastmod><changefreq>%s</changefreq><priority>%s</priority></url>'."\n", $data['url'], date('Y-m-d', strtotime($data['lastmod'])), $data['changefreq'], $data['priority']);
}

/**
Expand Down Expand Up @@ -281,7 +281,7 @@ private function generateImageLine(array $data): string
$images .= '</image:image>';
}

return sprintf(' '.'<url><loc>%s</loc>%s</url>'."\n", $data['url'], $images);
return sprintf(' <url><loc>%s</loc>%s</url>'."\n", $data['url'], $images);
}

/**
Expand All @@ -300,7 +300,7 @@ private function generateVideoLine(array $data): string
$videos .= sprintf('<video:%1$s>%2$s</video:%1$s>', $builder[$key] ?? $key, $video);
}

return sprintf(' '.'<url><loc>%s</loc><video:video>%s</video:video></url>'."\n", $data['url'], $videos);
return sprintf(' <url><loc>%s</loc><video:video>%s</video:video></url>'."\n", $data['url'], $videos);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Source/DoctrineODMQuerySourceIteratorTest.php
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Source/IteratorSourceIteratorTest.php
Expand Up @@ -24,7 +24,7 @@ final class IteratorSourceIteratorTest extends TestCase
/**
* @var \Iterator<mixed, mixed>&MockObject
*/
private $iterator;
private \Iterator $iterator;

protected function setUp(): void
{
Expand Down

0 comments on commit 17ba149

Please sign in to comment.