Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/DaveChild/TextStatistics/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static function cleanText($strText)
{

// Check for boolean before processing as string
if (is_bool($strText)) {
if (is_bool($strText) || is_null($strText)) {
return '';
}

Expand Down
1 change: 1 addition & 0 deletions tests/TextStatisticsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public function tearDown(): void
-------------------- */
public function testCleaning()
{
$this->assertSame('', DaveChild\TextStatistics\Text::cleanText(null));
$this->assertSame('', DaveChild\TextStatistics\Text::cleanText(false));
$this->assertSame('There once was a little sausage named Baldrick. and he lived happily ever after.', DaveChild\TextStatistics\Text::cleanText('There once was a little sausage named Baldrick. . . . And he lived happily ever after.!! !??'));
}
Expand Down