Skip to content

Commit 15451fa

Browse files
committed
Add isEmpty method implementation to multiple types (e.g., DateTime, Float, Integer, Bool) and corresponding tests to ensure consistent behavior across value objects.
1 parent f443e20 commit 15451fa

22 files changed

+116
-3
lines changed

src/Array/ArrayOfObjects.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,6 @@ public function count(): int
101101
return count($this->value);
102102
}
103103

104-
/**
105-
* Return true if the array is empty, false otherwise.
106-
*/
107104
public function isEmpty(): bool
108105
{
109106
return $this->count() === 0;

src/Bool/BoolStandard.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,9 @@ public function __toString(): string
121121
{
122122
return $this->toString();
123123
}
124+
125+
public function isEmpty(): bool
126+
{
127+
return false;
128+
}
124129
}

src/Bool/FalseStandard.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,9 @@ public function __toString(): string
125125
{
126126
return $this->toString();
127127
}
128+
129+
public function isEmpty(): bool
130+
{
131+
return false;
132+
}
128133
}

src/DateTime/DateTimeAtom.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,9 @@ public static function getFormat(): string
105105
{
106106
return static::FORMAT;
107107
}
108+
109+
public function isEmpty(): bool
110+
{
111+
return false;
112+
}
108113
}

src/DateTime/DateTimeRFC3339.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,9 @@ public static function getFormat(): string
105105
{
106106
return static::FORMAT;
107107
}
108+
109+
public function isEmpty(): bool
110+
{
111+
return false;
112+
}
108113
}

src/DateTime/DateTimeRFC3339Extended.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,9 @@ public static function getFormat(): string
106106
{
107107
return static::FORMAT;
108108
}
109+
110+
public function isEmpty(): bool
111+
{
112+
return false;
113+
}
109114
}

src/DateTime/DateTimeW3C.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,9 @@ public static function getFormat(): string
105105
{
106106
return static::FORMAT;
107107
}
108+
109+
public function isEmpty(): bool
110+
{
111+
return false;
112+
}
108113
}

src/Float/FloatNonNegative.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,9 @@ public function __toString(): string
107107
{
108108
return $this->toString();
109109
}
110+
111+
public function isEmpty(): bool
112+
{
113+
return false;
114+
}
110115
}

src/Float/FloatPositive.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,9 @@ public function __toString(): string
107107
{
108108
return $this->toString();
109109
}
110+
111+
public function isEmpty(): bool
112+
{
113+
return false;
114+
}
110115
}

src/Float/FloatStandard.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,9 @@ public function __toString(): string
9191
{
9292
return $this->toString();
9393
}
94+
95+
public function isEmpty(): bool
96+
{
97+
return false;
98+
}
9499
}

0 commit comments

Comments
 (0)