Skip to content

Commit 895f7ad

Browse files
authored
[BUGFIX] Fix type errors in PHP strict mode (#695)
This is the backport of #664.
1 parent 9e02002 commit 895f7ad

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
1919

2020
### Fixed
2121

22+
- Fix type errors in PHP strict mode (#695)
2223
- Fix comment parsing to support multiple comments (#671)
2324

2425
## 8.6.0

src/Value/Size.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public function render(OutputFormat $oOutputFormat)
223223
$l = localeconv();
224224
$sPoint = preg_quote($l['decimal_point'], '/');
225225
$sSize = preg_match("/[\d\.]+e[+-]?\d+/i", (string)$this->fSize)
226-
? preg_replace("/$sPoint?0+$/", "", sprintf("%f", $this->fSize)) : $this->fSize;
226+
? preg_replace("/$sPoint?0+$/", "", sprintf("%f", $this->fSize)) : (string)$this->fSize;
227227
return preg_replace(["/$sPoint/", "/^(-?)0\./"], ['.', '$1.'], $sSize)
228228
. ($this->sUnit === null ? '' : $this->sUnit);
229229
}

tests/ParserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ public function specificity()
279279
new Selector('ol li::before', true),
280280
], $oDoc->getSelectorsBySpecificity('< 100'));
281281
self::assertEquals([new Selector('li.green', true)], $oDoc->getSelectorsBySpecificity('11'));
282-
self::assertEquals([new Selector('ol li::before', true)], $oDoc->getSelectorsBySpecificity(3));
282+
self::assertEquals([new Selector('ol li::before', true)], $oDoc->getSelectorsBySpecificity('3'));
283283
}
284284

285285
/**

0 commit comments

Comments
 (0)