Skip to content

Commit

Permalink
Merge 3.x into 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
SonataCI committed Jun 2, 2023
2 parents f9cd8b5 + ac18c5d commit 080d589
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'],
'no_useless_else' => true,
'no_useless_return' => true,
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true, 'remove_inheritdoc' => true],
'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => true],
'ordered_class_elements' => true,
'ordered_imports' => ['sort_algorithm' => 'alpha', 'imports_order' => ['class', 'function', 'const']],
Expand Down
6 changes: 3 additions & 3 deletions src/Writer/CsvWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ public function write(array $data): void
++$this->position;
}

if (1 !== \strlen($this->delimiter) ||
1 !== \strlen($this->enclosure) ||
1 !== \strlen($this->escape)) {
if (1 !== \strlen($this->delimiter)
|| 1 !== \strlen($this->enclosure)
|| 1 !== \strlen($this->escape)) {
throw new InvalidDataFormatException(<<<'EXCEPTION'
Context: trying to write CSV data
Problem: delimiter, enclosure or escape character is actually a
Expand Down
5 changes: 5 additions & 0 deletions src/Writer/SitemapWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ final class SitemapWriter implements WriterInterface
* @param string $groupName Name of sub-sitemap (optional)
* @param string[] $headers Indicate the need for namespace in the header sitemap
* @param bool $autoIndex If you want to generate index of sitemap (optional)
*
* @phpstan-param non-empty-string $folder
*/
public function __construct(
private string $folder,
Expand Down Expand Up @@ -111,6 +113,9 @@ public function close(): void
* @param string $filename A sitemap file name, optional
*
* @throws \RuntimeException
*
* @phpstan-param non-empty-string $folder
* @phpstan-param non-empty-string $pattern
*/
public static function generateSitemapIndex(string $folder, string $baseUrl, string $pattern = 'sitemap*.xml', string $filename = 'sitemap.xml'): void
{
Expand Down
3 changes: 3 additions & 0 deletions tests/Writer/SitemapWriterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

final class SitemapWriterTest extends TestCase
{
/**
* @phpstan-var non-empty-string
*/
private string $folder;

protected function setUp(): void
Expand Down

0 comments on commit 080d589

Please sign in to comment.