diff --git a/composer.json b/composer.json index 6131b34..85bcdb3 100644 --- a/composer.json +++ b/composer.json @@ -16,8 +16,8 @@ } ], "require": { - "php": "^7.2", - "event-engine/php-data": "^1.0", + "php": "^7.4", + "event-engine/php-data": "^2.0-dev", "event-engine/php-engine-utils": "^0.1", "event-engine/php-schema": "^0.1", "ramsey/uuid": "^3.6" diff --git a/tests/Stub/ArrayItemRecord.php b/tests/Stub/ArrayItemRecord.php index 9b40849..800d730 100644 --- a/tests/Stub/ArrayItemRecord.php +++ b/tests/Stub/ArrayItemRecord.php @@ -18,7 +18,7 @@ private static function arrayPropItemTypeMap(): array /** * @var string[] */ - private $friends; + private array $friends; /** * @return string[] diff --git a/tests/Stub/CollectionItemAllowNestedRecord.php b/tests/Stub/CollectionItemAllowNestedRecord.php index 3bb40ac..a23e62e 100644 --- a/tests/Stub/CollectionItemAllowNestedRecord.php +++ b/tests/Stub/CollectionItemAllowNestedRecord.php @@ -10,14 +10,8 @@ final class CollectionItemAllowNestedRecord implements JsonSchemaAwareRecord { use JsonSchemaAwareRecordLogic; - /** - * @var ScalarPropsRecordAllowNestedCollection - */ - private $friends; + private ScalarPropsRecordAllowNestedCollection $friends; - /** - * @return ScalarPropsRecordAllowNestedCollection - */ public function friends(): ScalarPropsRecordAllowNestedCollection { return $this->friends; diff --git a/tests/Stub/CollectionItemRecord.php b/tests/Stub/CollectionItemRecord.php index 7652301..7686001 100644 --- a/tests/Stub/CollectionItemRecord.php +++ b/tests/Stub/CollectionItemRecord.php @@ -10,14 +10,8 @@ final class CollectionItemRecord implements JsonSchemaAwareRecord { use JsonSchemaAwareRecordLogic; - /** - * @var ScalarPropsRecordCollection - */ - private $friends; + private ScalarPropsRecordCollection $friends; - /** - * @return ScalarPropsRecordCollection - */ public function friends(): ScalarPropsRecordCollection { return $this->friends; diff --git a/tests/Stub/NullableArrayItemRecordAllowNestedRecord.php b/tests/Stub/NullableArrayItemRecordAllowNestedRecord.php index d2f7421..5bfe83d 100644 --- a/tests/Stub/NullableArrayItemRecordAllowNestedRecord.php +++ b/tests/Stub/NullableArrayItemRecordAllowNestedRecord.php @@ -24,7 +24,7 @@ private static function __allowNestedSchema(): bool /** * @var ScalarPropsRecord[]|null */ - private $friends; + private ?array $friends; /** * @return ScalarPropsRecord[]|null diff --git a/tests/Stub/NullableArrayItemRecordRecord.php b/tests/Stub/NullableArrayItemRecordRecord.php index 358fe81..70bb82c 100644 --- a/tests/Stub/NullableArrayItemRecordRecord.php +++ b/tests/Stub/NullableArrayItemRecordRecord.php @@ -18,7 +18,7 @@ private static function arrayPropItemTypeMap(): array /** * @var ScalarPropsRecord[]|null */ - private $friends; + private ?array $friends; /** * @return ScalarPropsRecord[]|null diff --git a/tests/Stub/NullableScalarPropsRecord.php b/tests/Stub/NullableScalarPropsRecord.php index d66725c..97c5111 100644 --- a/tests/Stub/NullableScalarPropsRecord.php +++ b/tests/Stub/NullableScalarPropsRecord.php @@ -10,53 +10,29 @@ final class NullableScalarPropsRecord implements JsonSchemaAwareRecord { use JsonSchemaAwareRecordLogic; - /** - * @var string|null - */ - private $userId; + private ?string $userId; - /** - * @var int|null - */ - private $age; + private ?int $age; - /** - * @var bool|null - */ - private $member; + private ?bool $member; - /** - * @var float|null - */ - private $score; + private ?float $score; - /** - * @return string|null - */ public function userId(): ?string { return $this->userId; } - /** - * @return int|null - */ public function age(): ?int { return $this->age; } - /** - * @return bool|null - */ public function member(): ?bool { return $this->member; } - /** - * @return float|null - */ public function score(): ?float { return $this->score; diff --git a/tests/Stub/ScalarPropsRecord.php b/tests/Stub/ScalarPropsRecord.php index fb8f244..f34a55e 100644 --- a/tests/Stub/ScalarPropsRecord.php +++ b/tests/Stub/ScalarPropsRecord.php @@ -10,53 +10,29 @@ final class ScalarPropsRecord implements JsonSchemaAwareRecord { use JsonSchemaAwareRecordLogic; - /** - * @var string - */ - private $userId; + private string $userId; - /** - * @var int - */ - private $age; + private int $age; - /** - * @var bool - */ - private $member; + private bool $member; - /** - * @var float - */ - private $score; + private float $score; - /** - * @return string - */ public function userId(): string { return $this->userId; } - /** - * @return int - */ public function age(): int { return $this->age; } - /** - * @return bool - */ public function member(): bool { return $this->member; } - /** - * @return float - */ public function score(): float { return $this->score; diff --git a/tests/Stub/ScalarPropsRecordAllowNestedCollection.php b/tests/Stub/ScalarPropsRecordAllowNestedCollection.php index d843b8e..0fa5df7 100644 --- a/tests/Stub/ScalarPropsRecordAllowNestedCollection.php +++ b/tests/Stub/ScalarPropsRecordAllowNestedCollection.php @@ -23,7 +23,7 @@ private static function __allowNestedSchema(): bool /** * @var ScalarPropsRecord[] */ - private $items; + private array $items; public static function fromArray(array $items): self { diff --git a/tests/Stub/ScalarPropsRecordCollection.php b/tests/Stub/ScalarPropsRecordCollection.php index cc11e3b..e1a935a 100644 --- a/tests/Stub/ScalarPropsRecordCollection.php +++ b/tests/Stub/ScalarPropsRecordCollection.php @@ -25,7 +25,7 @@ public static function validationRules(): array /** * @var ScalarPropsRecord[] */ - private $items; + private array $items; public static function fromArray(array $items): self { diff --git a/tests/Stub/VoOptionalPropsRecord.php b/tests/Stub/VoOptionalPropsRecord.php index 48191c3..f03126f 100644 --- a/tests/Stub/VoOptionalPropsRecord.php +++ b/tests/Stub/VoOptionalPropsRecord.php @@ -19,25 +19,13 @@ final class VoOptionalPropsRecord implements JsonSchemaAwareRecord public const MEMBER = 'member'; public const SCORE = 'score'; - /** - * @var UserId - */ - private $userId; + private UserId $userId; - /** - * @var Age - */ - private $age; + private Age $age; - /** - * @var Member - */ - private $member; + private Member $member; - /** - * @var Score - */ - private $score; + private Score $score; private static function __optionalProperties(): array { @@ -51,33 +39,21 @@ private function init(): void } } - /** - * @return UserId - */ public function userId(): UserId { return $this->userId; } - /** - * @return Age - */ public function age(): Age { return $this->age; } - /** - * @return Member - */ public function member(): Member { return $this->member; } - /** - * @return Score - */ public function score(): Score { return $this->score; diff --git a/tests/Stub/VoProp/Age.php b/tests/Stub/VoProp/Age.php index 4e16b0c..424e011 100644 --- a/tests/Stub/VoProp/Age.php +++ b/tests/Stub/VoProp/Age.php @@ -8,7 +8,7 @@ final class Age implements ProvidesValidationRules { - private $age; + private int $age; public static function validationRules(): array { diff --git a/tests/Stub/VoProp/Member.php b/tests/Stub/VoProp/Member.php index af5e5fb..5511f4a 100644 --- a/tests/Stub/VoProp/Member.php +++ b/tests/Stub/VoProp/Member.php @@ -5,7 +5,7 @@ final class Member { - private $flag; + private bool $flag; public static function fromBool(bool $flag): self { diff --git a/tests/Stub/VoProp/Score.php b/tests/Stub/VoProp/Score.php index c8dbe6a..11c8250 100644 --- a/tests/Stub/VoProp/Score.php +++ b/tests/Stub/VoProp/Score.php @@ -8,7 +8,7 @@ final class Score implements ProvidesValidationRules { - private $score; + private float $score; public static function validationRules(): array { diff --git a/tests/Stub/VoProp/UserId.php b/tests/Stub/VoProp/UserId.php index 2b3e84d..cedcaf9 100644 --- a/tests/Stub/VoProp/UserId.php +++ b/tests/Stub/VoProp/UserId.php @@ -9,7 +9,7 @@ final class UserId implements ProvidesValidationRules { public const PATTERN = '^[0-9]+$'; - private $userId; + private string $userId; public static function validationRules(): array { diff --git a/tests/Stub/VoPropsRecord.php b/tests/Stub/VoPropsRecord.php index a3407c7..7221483 100644 --- a/tests/Stub/VoPropsRecord.php +++ b/tests/Stub/VoPropsRecord.php @@ -19,53 +19,29 @@ final class VoPropsRecord implements JsonSchemaAwareRecord public const MEMBER = 'member'; public const SCORE = 'score'; - /** - * @var UserId - */ - private $userId; + private UserId $userId; - /** - * @var Age - */ - private $age; + private Age $age; - /** - * @var Member - */ - private $member; + private Member $member; - /** - * @var Score - */ - private $score; + private Score $score; - /** - * @return UserId - */ public function userId(): UserId { return $this->userId; } - /** - * @return Age - */ public function age(): Age { return $this->age; } - /** - * @return Member - */ public function member(): Member { return $this->member; } - /** - * @return Score - */ public function score(): Score { return $this->score;