Skip to content

Commit

Permalink
Make Type implementations nullable (#1357)
Browse files Browse the repository at this point in the history
  • Loading branch information
norberttech authored Jan 12, 2025
1 parent 81cdf31 commit 17837ca
Show file tree
Hide file tree
Showing 39 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/Function/Count.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function over(Window $window) : WindowFunction
}

/**
* @return Entry<?int, int>
* @return Entry<?int, ?int>
*/
public function result() : Entry
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/Function/Max.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function aggregate(Row $row) : void
}

/**
* @return Entry<?\DateTimeInterface, \DateTimeInterface>|Entry<?float, float>|Entry<?int, int>
* @return Entry<?\DateTimeInterface, ?\DateTimeInterface>|Entry<?float, ?float>|Entry<?int, ?int>
*/
public function result() : Entry
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/Function/Min.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function aggregate(Row $row) : void
}

/**
* @return Entry<?\DateTimeInterface, \DateTimeInterface>|Entry<?float, float>|Entry<?int, int>
* @return Entry<?\DateTimeInterface, ?\DateTimeInterface>|Entry<?float, ?float>|Entry<?int, ?int>
*/
public function result() : Entry
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/Function/Sum.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function over(Window $window) : WindowFunction
}

/**
* @return Entry<?float, float>|Entry<?int,int>
* @return Entry<?float, ?float>|Entry<?int,?int>
*/
public function result() : Entry
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Flow\ETL\PHP\Type\Type;

/**
* @implements Type<\DateTimeInterface>
* @implements Type<?\DateTimeInterface>
*/
final readonly class DateTimeType implements Type
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/PHP/Type/Logical/DateType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Flow\ETL\PHP\Type\Type;

/**
* @implements Type<\DateTimeInterface>
* @implements Type<?\DateTimeInterface>
*/
final readonly class DateType implements Type
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/PHP/Type/Logical/JsonType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Flow\ETL\PHP\Type\Type;

/**
* @implements Type<string>
* @implements Type<?string>
*/
final readonly class JsonType implements Type
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/PHP/Type/Logical/ListType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Flow\ETL\PHP\Type\{Type, TypeFactory};

/**
* @implements Type<list<mixed>>
* @implements Type<?list<mixed>>
*/
final readonly class ListType implements Type
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/PHP/Type/Logical/MapType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Flow\ETL\PHP\Type\{Type, TypeFactory};

/**
* @implements Type<array<array-key, mixed>>
* @implements Type<?array<array-key, mixed>>
*/
final readonly class MapType implements Type
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Flow\ETL\PHP\Type\{Type, TypeFactory};

/**
* @implements Type<array<string, mixed>>
* @implements Type<?array<string, mixed>>
*/
final readonly class StructureType implements Type
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/PHP/Type/Logical/TimeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Flow\ETL\PHP\Type\Type;

/**
* @implements Type<\DateInterval>
* @implements Type<?\DateInterval>
*/
final readonly class TimeType implements Type
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/PHP/Type/Logical/UuidType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Flow\ETL\PHP\Value\Uuid;

/**
* @implements Type<Uuid>
* @implements Type<?Uuid>
*/
final readonly class UuidType implements Type
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Flow\ETL\PHP\Type\Type;

/**
* @implements Type<\DOMElement>
* @implements Type<?\DOMElement>
*/
final readonly class XMLElementType implements Type
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/PHP/Type/Logical/XMLType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Flow\ETL\PHP\Type\Type;

/**
* @implements Type<\DOMDocument>
* @implements Type<?\DOMDocument>
*/
final readonly class XMLType implements Type
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/PHP/Type/Native/ArrayType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Flow\ETL\PHP\Type\Type;

/**
* @implements Type<array>
* @implements Type<?array>
*/
final readonly class ArrayType implements Type
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/PHP/Type/Native/BooleanType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Flow\ETL\PHP\Type\Type;

/**
* @implements Type<boolean>
* @implements Type<?boolean>
*/
final readonly class BooleanType implements Type
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/PHP/Type/Native/CallableType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Flow\ETL\PHP\Type\Type;

/**
* @implements Type<callable>
* @implements Type<?callable>
*/
final readonly class CallableType implements Type
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/PHP/Type/Native/EnumType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Flow\ETL\PHP\Type\Type;

/**
* @implements Type<\UnitEnum>
* @implements Type<?\UnitEnum>
*/
final readonly class EnumType implements Type
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/PHP/Type/Native/FloatType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Flow\ETL\PHP\Type\Type;

/**
* @implements Type<float>
* @implements Type<?float>
*/
final readonly class FloatType implements Type
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/PHP/Type/Native/IntegerType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Flow\ETL\PHP\Type\Type;

/**
* @implements Type<integer>
* @implements Type<?integer>
*/
final readonly class IntegerType implements Type
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/PHP/Type/Native/ObjectType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Flow\ETL\PHP\Type\Type;

/**
* @implements Type<object>
* @implements Type<?object>
*/
final readonly class ObjectType implements Type
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/PHP/Type/Native/ResourceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Flow\ETL\PHP\Type\Type;

/**
* @implements Type<resource>
* @implements Type<?resource>
*/
final readonly class ResourceType implements Type
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/PHP/Type/Native/StringType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Flow\ETL\PHP\Type\Type;

/**
* @implements Type<string>
* @implements Type<?string>
*/
final readonly class StringType implements Type
{
Expand Down
6 changes: 3 additions & 3 deletions src/core/etl/src/Flow/ETL/PHP/Type/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
namespace Flow\ETL\PHP\Type;

/**
* @template-covariant TType
* @template-covariant T of mixed
*/
interface Type
{
/**
* @return Type<TType>
* @return Type<T>
*/
public static function fromArray(array $data) : self;

Expand All @@ -27,7 +27,7 @@ public function isEqual(self $type) : bool;
public function isValid(mixed $value) : bool;

/**
* @return Type<TType>
* @return Type<T>
*/
public function makeNullable(bool $nullable) : self;

Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/Row/Entry/BooleanEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Flow\ETL\Row\{Entry, Reference};

/**
* @implements Entry<?bool, bool>
* @implements Entry<?bool, ?bool>
*/
final class BooleanEntry implements Entry
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/Row/Entry/DateEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Flow\ETL\Row\{Entry, Reference};

/**
* @implements Entry<?\DateTimeInterface, \DateTimeInterface>
* @implements Entry<?\DateTimeInterface, ?\DateTimeInterface>
*/
final class DateEntry implements Entry
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/Row/Entry/DateTimeEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Flow\ETL\Row\{Entry, Reference};

/**
* @implements Entry<?\DateTimeInterface, \DateTimeInterface>
* @implements Entry<?\DateTimeInterface, ?\DateTimeInterface>
*/
final class DateTimeEntry implements Entry
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/Row/Entry/EnumEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Flow\ETL\Row\{Entry, Reference};

/**
* @implements Entry<?\UnitEnum, \UnitEnum>
* @implements Entry<?\UnitEnum, ?\UnitEnum>
*/
final class EnumEntry implements Entry
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/Row/Entry/FloatEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Flow\ETL\Row\{Entry, Reference};

/**
* @implements Entry<?float, float>
* @implements Entry<?float, ?float>
*/
final class FloatEntry implements Entry
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/Row/Entry/IntegerEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Flow\ETL\Row\{Entry, Reference};

/**
* @implements Entry<?int, int>
* @implements Entry<?int, ?int>
*/
final class IntegerEntry implements Entry
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/Row/Entry/JsonEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Flow\ETL\Row\{Entry, Reference};

/**
* @implements Entry<?array<mixed>, string>
* @implements Entry<?array<mixed>, ?string>
*/
final class JsonEntry implements Entry
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/Row/Entry/ListEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Flow\ETL\Row\{Entry, Reference};

/**
* @implements Entry<?list<mixed>, list<mixed>>
* @implements Entry<?list<mixed>, ?list<mixed>>
*/
final class ListEntry implements Entry
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/Row/Entry/MapEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Flow\ETL\Row\{Entry, Reference};

/**
* @implements Entry<?array<array-key, mixed>, array<array-key, mixed>>
* @implements Entry<?array<array-key, mixed>, ?array<array-key, mixed>>
*/
final class MapEntry implements Entry
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/Row/Entry/StringEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Flow\ETL\Row\{Entry, Reference, Schema\Metadata};

/**
* @implements Entry<?string, string>
* @implements Entry<?string, ?string>
*/
final class StringEntry implements Entry
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/Row/Entry/StructureEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Flow\ETL\Row\{Entry, Reference};

/**
* @implements Entry<?array<string, mixed>, array<string, mixed>>
* @implements Entry<?array<string, mixed>, ?array<string, mixed>>
*/
final class StructureEntry implements Entry
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/Row/Entry/TimeEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Flow\ETL\Row\{Entry, Reference};

/**
* @implements Entry<?\DateInterval, \DateInterval>
* @implements Entry<?\DateInterval, ?\DateInterval>
*/
final class TimeEntry implements Entry
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/Row/Entry/UuidEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Flow\ETL\Row\{Entry, Reference};

/**
* @implements Entry<?Uuid, Uuid>
* @implements Entry<?Uuid, ?Uuid>
*/
final class UuidEntry implements Entry
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/Row/Entry/XMLElementEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Flow\ETL\Row\{Entry, Reference};

/**
* @implements Entry<?\DOMElement, \DOMElement>
* @implements Entry<?\DOMElement, ?\DOMElement>
*/
final class XMLElementEntry implements Entry
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/Row/Entry/XMLEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Flow\ETL\Row\{Entry, Reference};

/**
* @implements Entry<?\DOMDocument, \DOMDocument>
* @implements Entry<?\DOMDocument, ?\DOMDocument>
*/
final class XMLEntry implements Entry
{
Expand Down

0 comments on commit 17837ca

Please sign in to comment.