Skip to content

Commit

Permalink
DevKit updates for 2.x branch (#608)
Browse files Browse the repository at this point in the history
* DevKit updates

* Fix cs

* Fix phpstan

* DevKit updates

Co-authored-by: Vincent Langlet <vincentlanglet@hotmail.fr>
  • Loading branch information
SonataCI and VincentLanglet committed Sep 3, 2022
1 parent 57e20da commit 2134571
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
'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']],
'phpdoc_order' => ['order' => ['var', 'param', 'throws', 'return', 'phpstan-var', 'psalm-var', 'phpstan-param', 'psalm-param', 'phpstan-return', 'psalm-return']],
'phpdoc_separation' => ['groups' => [
['phpstan-template', 'phpstan-template-covariant', 'phpstan-extends', 'phpstan-implements', 'phpstan-var', 'psalm-var', 'phpstan-param', 'psalm-param', 'phpstan-return', 'psalm-return'],
['psalm-suppress', 'phpstan-ignore-next-line'],
]],
'php_unit_strict' => true,
'php_unit_test_case_static_method_calls' => true,
'phpdoc_to_comment' => ['ignored_tags' => ['psalm-suppress', 'phpstan-var']],
Expand Down
1 change: 1 addition & 0 deletions src/Source/AbstractXmlSourceIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ abstract class AbstractXmlSourceIterator implements SourceIteratorInterface

/**
* @var resource|null
*
* @phpstan-var resource|null
* @psalm-var resource|closed-resource|null
*/
Expand Down
1 change: 1 addition & 0 deletions src/Source/CsvSourceIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ final class CsvSourceIterator implements SourceIteratorInterface

/**
* @var resource|null
*
* @phpstan-var resource|null
* @psalm-var resource|closed-resource|null
*/
Expand Down
1 change: 1 addition & 0 deletions src/Source/DoctrineODMQuerySourceIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function __construct(Query $query, array $fields, string $dateTimeFormat
/**
* @return array<string, mixed>
*/
#[\ReturnTypeWillChange]
public function current()
{
$current = $this->iterator->current();
Expand Down
1 change: 1 addition & 0 deletions src/Source/DoctrineORMQuerySourceIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public function __construct(Query $query, array $fields, string $dateTimeFormat
/**
* @return array<string, mixed>
*/
#[\ReturnTypeWillChange]
public function current()
{
$current = $this->iterator->current();
Expand Down
1 change: 1 addition & 0 deletions src/Source/IteratorCallbackSourceIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public function __construct(\Iterator $iterator, \Closure $transformer)
/**
* @return array<mixed>
*/
#[\ReturnTypeWillChange]
public function current()
{
return \call_user_func($this->transformer, $this->iterator->current());
Expand Down
2 changes: 2 additions & 0 deletions src/Source/SymfonySitemapSourceIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public function __construct(
/**
* @return array<string, mixed>
*/
#[\ReturnTypeWillChange]
public function current()
{
$data = $this->source->current();
Expand All @@ -65,6 +66,7 @@ public function next(): void
$this->source->next();
}

#[\ReturnTypeWillChange]
public function key()
{
return $this->source->key();
Expand Down
1 change: 1 addition & 0 deletions src/Writer/CsvWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ final class CsvWriter implements TypedWriterInterface

/**
* @var resource|null
*
* @phpstan-var resource|null
* @psalm-var resource|closed-resource|null
*/
Expand Down
1 change: 1 addition & 0 deletions src/Writer/GsaFeedWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ final class GsaFeedWriter implements WriterInterface

/**
* @var resource|null
*
* @phpstan-var resource|null
* @psalm-var resource|closed-resource|null
*/
Expand Down
1 change: 1 addition & 0 deletions src/Writer/JsonWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ final class JsonWriter implements TypedWriterInterface

/**
* @var resource|null
*
* @phpstan-var resource|null
* @psalm-var resource|closed-resource|null
*/
Expand Down
1 change: 1 addition & 0 deletions src/Writer/SitemapWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ final class SitemapWriter implements WriterInterface

/**
* @var resource|null
*
* @phpstan-var resource|null
* @psalm-var resource|closed-resource|null
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Writer/WriterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@
interface WriterInterface
{
/**
* @return void
*
* @throws SonataExporterException
*
* @return void
*/
public function open();

/**
* @param mixed[] $data
*
* @return void
*
* @throws SonataExporterException
*
* @return void
*/
public function write(array $data);

Expand Down
1 change: 1 addition & 0 deletions src/Writer/XlsWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ final class XlsWriter implements TypedWriterInterface

/**
* @var resource|null
*
* @phpstan-var resource|null
* @psalm-var resource|closed-resource|null
*/
Expand Down
1 change: 1 addition & 0 deletions src/Writer/XmlExcelWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ final class XmlExcelWriter implements WriterInterface

/**
* @var resource|null
*
* @phpstan-var resource|null
* @psalm-var resource|closed-resource|null
*/
Expand Down
1 change: 1 addition & 0 deletions src/Writer/XmlWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ final class XmlWriter implements TypedWriterInterface

/**
* @var resource|null
*
* @phpstan-var resource|null
* @psalm-var resource|closed-resource|null
*/
Expand Down

0 comments on commit 2134571

Please sign in to comment.