From 2e2f46d2cc211bf37980692d5fb30c58a5bd6c38 Mon Sep 17 00:00:00 2001 From: Sergey Romanenko Date: Sun, 8 May 2022 17:02:48 +0300 Subject: [PATCH] fix(strings): fix tests and methods `toNull` and `isNull` --- CHANGELOG.md | 4 ++++ src/Strings.php | 4 ++-- tests/StringsTest.php | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea241c4..c47d247 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ + +# [4.3.1](https://github.com/glowyphp/strings) (2022-05-08) +* Fix toNull() method. + # [4.3.0](https://github.com/glowyphp/strings) (2022-05-08) * Added isNull() method. diff --git a/src/Strings.php b/src/Strings.php index 6abc3d8..056a978 100644 --- a/src/Strings.php +++ b/src/Strings.php @@ -2138,9 +2138,9 @@ public function toFloat(): float /** * Return Strings object as null. * - * @return float Return Strings object as null. + * @return null Return Strings object as null. */ - public function toNull(): float + public function toNull() { return null; } diff --git a/tests/StringsTest.php b/tests/StringsTest.php index 486742c..58254e3 100644 --- a/tests/StringsTest.php +++ b/tests/StringsTest.php @@ -867,6 +867,10 @@ $this->assertTrue(Strings::create('null')->isNull()); }); +test('test toNull() method', function (): void { + $this->assertTrue(Strings::create('null')->toNull() === null); +}); + test('test isMAC() method', function (): void { $this->assertTrue(Strings::create('00:11:22:33:44:55')->isMAC()); $this->assertFalse(Strings::create('127.0.0.1')->isMAC());