Skip to content

Commit

Permalink
Fix Psalm issues after upgrading to v6
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean85 committed Feb 8, 2025
1 parent 06d108c commit 7ea4b42
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 23 deletions.
31 changes: 9 additions & 22 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.7.7@e028ba46ba0d7f9a78bc3201c251e137383e145f">
<file src="src/Configuration/PHPUnitConfig.php">
<DocblockTypeContradiction>
<code><![CDATA[$extension->attributes]]></code>
</DocblockTypeContradiction>
<RedundantConditionGivenDocblockType>
<code><![CDATA[$extension->attributes?->getNamedItem('class')]]></code>
</RedundantConditionGivenDocblockType>
</file>
<files psalm-version="6.5.0@38fc8444edf0cebc9205296ee6e30e906ade783b">
<file src="src/Configuration/ParallelConfiguration.php">
<MixedArgument>
<code><![CDATA[$input->getArgument('stringFilter')]]></code>
<code><![CDATA[$input->getOption('chunk-size')]]></code>
<code><![CDATA[$input->getOption('configuration') ?? '.']]></code>
<code><![CDATA[$input->getOption('exclude-testsuite')]]></code>
<code><![CDATA[$input->getOption('logo')]]></code>
<code><![CDATA[$input->getOption('parallel')]]></code>
<code><![CDATA[$input->getOption('pass-through')]]></code>
<code><![CDATA[$input->getOption('testsuite')]]></code>
<code><![CDATA[$input->getOption('exclude-testsuite')]]></code>
<code><![CDATA[$input->getOption('sort')]]></code>
<code><![CDATA[$input->getOption('test-suffix')]]></code>
<code><![CDATA[$input->getOption('testsuite')]]></code>
</MixedArgument>
</file>
<file src="src/Coverage/CoverageFetcher.php">
<MixedAssignment>
<code>$codeCoverage</code>
<code><![CDATA[$codeCoverage]]></code>
</MixedAssignment>
</file>
<file src="src/File/Cleaner.php">
Expand All @@ -33,27 +25,22 @@
<code><![CDATA[$file->getRealPath()]]></code>
</MixedArgument>
<MixedAssignment>
<code>$file</code>
<code><![CDATA[$file]]></code>
</MixedAssignment>
<MixedMethodCall>
<code>getRealPath</code>
<code>getRealPath</code>
<code>isDir</code>
<code><![CDATA[getRealPath]]></code>
<code><![CDATA[getRealPath]]></code>
<code><![CDATA[isDir]]></code>
</MixedMethodCall>
</file>
<file src="src/Filter/Filter.php">
<PossiblyNullOperand>
<code><![CDATA[$fileNode->nodeValue]]></code>
</PossiblyNullOperand>
</file>
<file src="src/Process/CommandLine.php">
<PossiblyNullOperand>
<code><![CDATA[$option->getValue()]]></code>
</PossiblyNullOperand>
</file>
<file src="src/Process/SymfonyProcessWrapper.php">
<MixedArgumentTypeCoercion>
<code>$env</code>
<code><![CDATA[$env]]></code>
</MixedArgumentTypeCoercion>
</file>
</files>
2 changes: 1 addition & 1 deletion src/Logs/ValueObject/LogData.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private function convertToUtf8(string $string): string
{
/** @psalm-suppress RiskyTruthyFalsyComparison */
if (! \mb_detect_encoding($string, 'UTF-8', true)) {
return \mb_convert_encoding($string, 'UTF-8');
return \mb_convert_encoding($string, 'UTF-8') ?: '';

Check warning on line 62 in src/Logs/ValueObject/LogData.php

View check run for this annotation

Codecov / codecov/patch

src/Logs/ValueObject/LogData.php#L62

Added line #L62 was not covered by tests
}

return $string;
Expand Down

0 comments on commit 7ea4b42

Please sign in to comment.