Skip to content

Commit 2e2f46d

Browse files
committed
fix(strings): fix tests and methods toNull and isNull
1 parent 7299b51 commit 2e2f46d

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<a name="4.3.1"></a>
2+
# [4.3.1](https://github.com/glowyphp/strings) (2022-05-08)
3+
* Fix toNull() method.
4+
15
<a name="4.3.0"></a>
26
# [4.3.0](https://github.com/glowyphp/strings) (2022-05-08)
37
* Added isNull() method.

src/Strings.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2138,9 +2138,9 @@ public function toFloat(): float
21382138
/**
21392139
* Return Strings object as null.
21402140
*
2141-
* @return float Return Strings object as null.
2141+
* @return null Return Strings object as null.
21422142
*/
2143-
public function toNull(): float
2143+
public function toNull()
21442144
{
21452145
return null;
21462146
}

tests/StringsTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,10 @@
867867
$this->assertTrue(Strings::create('null')->isNull());
868868
});
869869

870+
test('test toNull() method', function (): void {
871+
$this->assertTrue(Strings::create('null')->toNull() === null);
872+
});
873+
870874
test('test isMAC() method', function (): void {
871875
$this->assertTrue(Strings::create('00:11:22:33:44:55')->isMAC());
872876
$this->assertFalse(Strings::create('127.0.0.1')->isMAC());

0 commit comments

Comments
 (0)