Skip to content

Commit 8756928

Browse files
committed
fixing another deprecation
1 parent 90b3d85 commit 8756928

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

src/php/Webforge/Common/DateTime/DateInterval.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,16 @@ public function convertSimpleSpec($spec)
4040
/**
4141
* Zusätzlich zum normalen Format gehen %u (microseconds) und %n (milliseconds) analag %U und %N
4242
*/
43-
public function format(string $string): ?string
43+
public function format(string $string): string
4444
{
4545
$ret = parent::format($string);
46-
if ($ret === null) {
47-
return null;
48-
}
4946

50-
if (mb_stripos($string, '%u')) {
47+
if (mb_stripos($string, '%u') !== false) {
5148
$ret = preg_replace('/(?<!%)%u/u', (string) $this->getUS(), $ret);
5249
$ret = preg_replace('/(?<!%)%U/u', sprintf('%02d', $this->getUS()), $ret);
5350
}
5451

55-
if (mb_stripos($string, '%n')) {
52+
if (mb_stripos($string, '%n') !== false) {
5653
$ret = preg_replace('/(?<!%)%n/u', sprintf('%d', (int)($this->getUS() / 1000)), $ret);
5754
$ret = preg_replace('/(?<!%)%N/u', sprintf('%02d', (int)($this->getUS() / 1000)), $ret);
5855
}

0 commit comments

Comments
 (0)