Skip to content

Commit

Permalink
[TASK] Upgrade to Psalm 5 (#1199)
Browse files Browse the repository at this point in the history
Also update the baseline with the newly-found warnings (which we can
tackle in future changes).
  • Loading branch information
oliverklee committed Nov 30, 2022
1 parent 867a952 commit 06785d1
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .phive/phars.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
<phar name="php-cs-fixer" version="^3.13.0" installed="3.13.0" location="./.phive/php-cs-fixer" copy="false"/>
<phar name="phpcs" version="^3.7.1" installed="3.7.1" location="./.phive/phpcs" copy="false"/>
<phar name="phpmd" version="^2.13.0" installed="2.13.0" location="./.phive/phpmd" copy="false"/>
<phar name="psalm" version="^4.30.0" installed="4.30.0" location="./.phive/psalm" copy="false"/>
<phar name="psalm" version="^5.0.0" installed="5.0.0" location="./.phive/psalm" copy="false"/>
</phive>
81 changes: 74 additions & 7 deletions psalm.baseline.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.x-dev@">
<files psalm-version="dev-master@">
<file src="src/CssInliner.php">
<PossiblyNullOperand occurrences="1">
<InvalidArgument occurrences="1"/>
<MixedArgument occurrences="1">
<code>$styleNode</code>
</MixedArgument>
<MixedAssignment occurrences="8">
<code>$matchingNodes</code>
<code>$node</code>
<code>$nodesMatchingCssSelectors</code>
<code>$nodesMatchingSelector</code>
<code>$parentNode</code>
<code>$path</code>
<code>$styleNode</code>
<code>$styleNodes</code>
</MixedAssignment>
<MixedMethodCall occurrences="1">
<code>getNodePath</code>
</MixedMethodCall>
<MixedOperand occurrences="2">
<code>$path</code>
<code>$styleNode-&gt;nodeValue</code>
</PossiblyNullOperand>
</MixedOperand>
<MixedPropertyFetch occurrences="3">
<code>$nodesMatchingSelector-&gt;length</code>
<code>$styleNode-&gt;nodeValue</code>
<code>$styleNode-&gt;parentNode</code>
</MixedPropertyFetch>
<RawObjectIteration occurrences="3">
<code>$matchingNodes</code>
<code>$nodesMatchingCssSelectors</code>
<code>$styleNodes</code>
</RawObjectIteration>
<ReservedWord occurrences="3">
<code>$matchingNodes</code>
<code>$nodesMatchingCssSelectors</code>
<code>$styleNodes</code>
</ReservedWord>
<UndefinedClass occurrences="1">
<code>$nodesMatchingSelector-&gt;length</code>
</UndefinedClass>
</file>
<file src="src/HtmlProcessor/CssToAttributeConverter.php">
<MixedInferredReturnType occurrences="1">
<code>\DOMNodeList</code>
</MixedInferredReturnType>
<MixedReturnStatement occurrences="1">
<code>$this-&gt;getXPath()-&gt;query('//*[@style]')</code>
</MixedReturnStatement>
</file>
<file src="src/HtmlProcessor/AbstractHtmlProcessor.php">
<ArgumentTypeCoercion occurrences="1">
<code>$this-&gt;prepareHtmlForDomConversion($html)</code>
</ArgumentTypeCoercion>
<file src="src/HtmlProcessor/HtmlPruner.php">
<MixedArgument occurrences="2">
<code>$elementsWithClassAttribute</code>
<code>$elementsWithClassAttribute</code>
</MixedArgument>
<MixedAssignment occurrences="4">
<code>$element</code>
<code>$elementsWithClassAttribute</code>
<code>$elementsWithStyleDisplayNone</code>
<code>$parentNode</code>
</MixedAssignment>
<MixedMethodCall occurrences="1">
<code>removeChild</code>
</MixedMethodCall>
<MixedPropertyFetch occurrences="2">
<code>$element-&gt;parentNode</code>
<code>$elementsWithStyleDisplayNone-&gt;length</code>
</MixedPropertyFetch>
<RawObjectIteration occurrences="1">
<code>$elementsWithStyleDisplayNone</code>
</RawObjectIteration>
<ReservedWord occurrences="1">
<code>$elementsWithStyleDisplayNone</code>
</ReservedWord>
<UndefinedClass occurrences="1">
<code>$elementsWithStyleDisplayNone-&gt;length</code>
</UndefinedClass>
</file>
</files>

0 comments on commit 06785d1

Please sign in to comment.