From 851e6914b6173d786b14caffbce4fa3ebc790fcd Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 7 Aug 2024 11:31:12 +0900 Subject: [PATCH] test: add type definitions --- tests/system/Entity/EntityTest.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/system/Entity/EntityTest.php b/tests/system/Entity/EntityTest.php index e81111be0214..b0ec5ebbda92 100644 --- a/tests/system/Entity/EntityTest.php +++ b/tests/system/Entity/EntityTest.php @@ -1113,19 +1113,19 @@ protected function getEntity() 'createdAt' => 'created_at', ]; - public function setBar($value) + public function setBar(int|string $value): self { $this->attributes['bar'] = "bar:{$value}"; return $this; } - public function getBar() + public function getBar(): string { return "{$this->attributes['bar']}:bar"; } - public function getFakeBar() + public function getFakeBar(): string { return "{$this->attributes['bar']}:bar"; } @@ -1152,26 +1152,26 @@ protected function getNewSetterGetterEntity() ]; private string $bar; - public function setBar($value) + public function setBar(string $value): self { $this->bar = $value; return $this; } - public function getBar() + public function getBar(): string { return $this->bar; } - public function _setBar($value) + public function _setBar(string $value): self { $this->attributes['bar'] = "bar:{$value}"; return $this; } - public function _getBar() + public function _getBar(): string { return "{$this->attributes['bar']}:bar"; } @@ -1201,7 +1201,7 @@ protected function setSimple(string $val): void $this->attributes['simple'] = 'oo:' . $val; } - protected function getSimple() + protected function getSimple(): string { return $this->attributes['simple'] . ':oo'; } @@ -1296,7 +1296,7 @@ protected function getCastEntity($data = null): Entity 'thirteenth' => 'uri', ]; - public function setSeventh($seventh): void + public function setSeventh(string $seventh): void { $this->attributes['seventh'] = $seventh; }