Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Update to Psalm 5.6 #1211

Merged
merged 1 commit into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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="^5.0.0" installed="5.0.0" location="./.phive/psalm" copy="false"/>
<phar name="psalm" version="^5.6.0" installed="5.6.0" location="./.phive/psalm" copy="false"/>
</phive>
90 changes: 15 additions & 75 deletions psalm.baseline.xml
Original file line number Diff line number Diff line change
@@ -1,80 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="dev-master@">
<files psalm-version="5.6.0@e784128902dfe01d489c4123d69918a9f3c1eac5">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've seen this weird change before, and found it to be a non-issue, IIRC.

<file src="src/CssInliner.php">
<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>
<InvalidArgument>
<code>\usort(
$cssRules['inlinable'],
/**
* @param array{selector: string, line: int} $first
* @param array{selector: string, line: int} $second
*/
function (array $first, array $second): int {
return $this-&gt;sortBySelectorPrecedence($first, $second);
}
)</code>
</InvalidArgument>
JakeQZ marked this conversation as resolved.
Show resolved Hide resolved
<PossiblyNullOperand>
<code>$styleNode-&gt;nodeValue</code>
</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/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>
</PossiblyNullOperand>
</file>
</files>
1 change: 1 addition & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<psalm
errorLevel="1"
strictBinaryOperands="true"
findUnusedBaselineEntry="true"
JakeQZ marked this conversation as resolved.
Show resolved Hide resolved
findUnusedCode="false"
findUnusedVariablesAndParams="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand Down