Skip to content

Commit 72a2a60

Browse files
committed
[BUGFIX] Fix type errors in strict mode
1 parent 5a25712 commit 72a2a60

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
@@ -46,6 +46,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
4646

4747
### Fixed
4848

49+
- Fix type errors in strict mode (#664)
4950
- Fix undefined local variable in `CalcFunction::parse()` (#593)
5051
- Fix PHP notice caused by parsing invalid color values having less than 6 characters (#485)
5152
- Fix (regression) failure to parse at-rules with strict parsing (#456)

src/Value/Size.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public function render(OutputFormat $oOutputFormat): string
204204
$l = \localeconv();
205205
$sPoint = \preg_quote($l['decimal_point'], '/');
206206
$sSize = \preg_match('/[\\d\\.]+e[+-]?\\d+/i', (string) $this->fSize)
207-
? \preg_replace("/$sPoint?0+$/", '', \sprintf('%f', $this->fSize)) : $this->fSize;
207+
? \preg_replace("/$sPoint?0+$/", '', \sprintf('%f', $this->fSize)) : (string)$this->fSize;
208208
return \preg_replace(["/$sPoint/", '/^(-?)0\\./'], ['.', '$1.'], $sSize)
209209
. ($this->sUnit ?? '');
210210
}

tests/ParserTest.php

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

284284
/**

0 commit comments

Comments
 (0)