Skip to content

Commit d32200b

Browse files
Merge pull request #6 from michael-rubel/patch/method-comments
Allow passing `null` to `makeOrNull` method
2 parents 54e6e7b + 6fa0c3d commit d32200b

File tree

10 files changed

+10
-9
lines changed

10 files changed

+10
-9
lines changed

src/Collection/Complex/ClassString.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*
2626
* @method static static make(string $string)
2727
* @method static static from(string $string)
28-
* @method static static makeOrNull(string $string)
28+
* @method static static makeOrNull(string|null $string)
2929
*
3030
* @extends ValueObject<TKey, TValue>
3131
*/

src/Collection/Complex/FullName.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*
2929
* @method static static make(string|Stringable $value)
3030
* @method static static from(string|Stringable $value)
31-
* @method static static makeOrNull(string|Stringable $value)
31+
* @method static static makeOrNull(string|Stringable|null $value)
3232
*
3333
* @extends ValueObject<TKey, TValue>
3434
*/

src/Collection/Complex/Name.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*
2626
* @method static static make(string|Stringable $value)
2727
* @method static static from(string|Stringable $value)
28-
* @method static static makeOrNull(string|Stringable $value)
28+
* @method static static makeOrNull(string|Stringable|null $value)
2929
*
3030
* @extends Text<TKey, TValue>
3131
*/

src/Collection/Complex/TaxNumber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
* @method static static make(string $number, string|null $prefix = null)
2828
* @method static static from(string $number, string|null $prefix = null)
29-
* @method static static makeOrNull(string $number, string|null $prefix = null)
29+
* @method static static makeOrNull(string|null $number, string|null $prefix = null)
3030
*
3131
* @extends ValueObject<TKey, TValue>
3232
*/

src/Collection/Complex/Uuid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*
2626
* @method static static make(string $value, string|null $name = null)
2727
* @method static static from(string $value, string|null $name = null)
28-
* @method static static makeOrNull(string $value, string|null $name = null)
28+
* @method static static makeOrNull(string|null $value, string|null $name = null)
2929
*
3030
* @extends ValueObject<TKey, TValue>
3131
*/

src/Collection/Primitive/Boolean.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*
2626
* @method static static make(bool|int|string $value)
2727
* @method static static from(bool|int|string $value)
28-
* @method static static makeOrNull(bool|int|string $value)
28+
* @method static static makeOrNull(bool|int|string|null $value)
2929
*
3030
* @extends ValueObject<TKey, TValue>
3131
*/

src/Collection/Primitive/Decimal.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
* @method static static make(int|string $number, int $scale = 2)
2828
* @method static static from(int|string $number, int $scale = 2)
29-
* @method static static makeOrNull(int|string $number, int $scale = 2)
29+
* @method static static makeOrNull(int|string|null $number, int $scale = 2)
3030
*
3131
* @extends ValueObject<TKey, TValue>
3232
*/

src/Collection/Primitive/Integer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
* @method static static make(int|string $number)
2828
* @method static static from(int|string $number)
29-
* @method static static makeOrNull(int|string $number)
29+
* @method static static makeOrNull(int|string|null $number)
3030
*
3131
* @extends ValueObject<TKey, TValue>
3232
*/

src/Collection/Primitive/Text.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
* @method static static make(string|Stringable $value)
2828
* @method static static from(string|Stringable $value)
29-
* @method static static makeOrNull(string|Stringable $value)
29+
* @method static static makeOrNull(string|Stringable|null $value)
3030
*
3131
* @extends ValueObject<TKey, TValue>
3232
*/

tests/Unit/ValueObjectTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
});
1515

1616
test('can use makeOrNull', function () {
17+
$this->assertNull(Text::makeOrNull(null));
1718
$this->assertNull(Text::makeOrNull(''));
1819
$this->assertNull(Text::makeOrNull('')?->value());
1920

0 commit comments

Comments
 (0)