Skip to content

Commit c14e575

Browse files
committed
[BUGFIX] Fix type errors in strict mode
1 parent baaf951 commit c14e575

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
@@ -206,7 +206,7 @@ public function render(OutputFormat $oOutputFormat): string
206206
$l = \localeconv();
207207
$sPoint = \preg_quote($l['decimal_point'], '/');
208208
$sSize = \preg_match('/[\\d\\.]+e[+-]?\\d+/i', (string) $this->fSize)
209-
? \preg_replace("/$sPoint?0+$/", '', \sprintf('%f', $this->fSize)) : $this->fSize;
209+
? \preg_replace("/$sPoint?0+$/", '', \sprintf('%f', $this->fSize)) : (string)$this->fSize;
210210
return \preg_replace(["/$sPoint/", '/^(-?)0\\./'], ['.', '$1.'], $sSize)
211211
. ($this->sUnit ?? '');
212212
}

tests/ParserTest.php

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

286286
/**

0 commit comments

Comments
 (0)