MyIntervals / emogrifier

Converts CSS styles into inline style attributes in your HTML code.
https://www.myintervals.com/emogrifier.php
MIT License
904 stars 153 forks source link

Psalm errors #1130

Open JakeQZ opened 2 years ago

JakeQZ commented 2 years ago

https://github.com/MyIntervals/emogrifier/runs/4501517147

ERROR: UnnecessaryVarAnnotation - src/Css/CssDocument.php:44:18 - The @var Sabberworm\CSS\CSSList\Document annotation for $sabberwormCssDocument is unnecessary (see https://psalm.dev/212)
        /** @var SabberwormCssDocument $sabberwormCssDocument */

ERROR: ArgumentTypeCoercion - src/Css/CssDocument.php:98:39 - Argument 1 of Sabberworm\CSS\CSSList\Document::setContents expects array<int, Sabberworm\CSS\CSSList\CSSList|Sabberworm\CSS\Property\Charset|Sabberworm\CSS\Property\Import|Sabberworm\CSS\RuleSet\RuleSet>, parent type non-empty-array<int, Sabberworm\CSS\Renderable> provided (see https://psalm.dev/193)
        $atRulesDocument->setContents($atRules);

ERROR: UnnecessaryVarAnnotation - src/Css/CssDocument.php:100:18 - The @var string annotation for $renderedRules is unnecessary (see https://psalm.dev/212)
        /** @var string $renderedRules */

ERROR: UnnecessaryVarAnnotation - src/Css/CssDocument.php:118:22 - The @var string annotation for $mediaQueryList is unnecessary (see https://psalm.dev/212)
            /** @var string $mediaQueryList */

ERROR: InvalidArgument - tests/Unit/Css/StyleRuleTest.php:96:29 - Argument 1 of Sabberworm\CSS\Rule\Rule::setValue expects Sabberworm\CSS\Value\RuleValueList|null, string provided (see https://psalm.dev/004)
            $rule->setValue($declaration['value']);

Probably relates to #1127.

oliverklee commented 2 years ago

https://github.com/sabberworm/PHP-CSS-Parser/pull/348 fixes on of the two remaining warnings.