Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit cb57c45

Browse files
authored
Merge pull request #14 from WoltLab/missing-text-not-null
Do not pass `null` to the `$text` parameter of adapter's `notify()`
2 parents 3efb7e1 + 965a447 commit cb57c45

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/ProgressBar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class ProgressBar
4242
*
4343
* @var string
4444
*/
45-
protected $statusText = null;
45+
protected $statusText = '';
4646

4747
/**
4848
* Adapter for the output

test/ProgressBarTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ public function testEtaZeroPercent()
8080
$this->assertEquals(null, $progressBar->getTimeRemaining());
8181
}
8282

83+
public function testMissingTextIsNotNull()
84+
{
85+
$progressBar = $this->_getProgressBar(0, 100);
86+
87+
$this->assertSame('', $progressBar->getText());
88+
}
89+
8390
// @codingStandardsIgnoreStart
8491
protected function _getProgressBar($min, $max, $persistenceNamespace = null)
8592
{

0 commit comments

Comments
 (0)