phpro / grumphp

A PHP code-quality tool
MIT License
4.13k stars 430 forks source link

Fix psalm errors #872

Closed Landerstraeten closed 3 years ago

Landerstraeten commented 3 years ago

Fixes #869

Fix current psalm errors on master:

psalm
=====

ERROR: PossiblyInvalidIterator - src/Configuration/Compiler/TaskCompilerPass.php:37:18 - Cannot iterate over scalar (see https://psalm.dev/165)
        foreach ($configuredTasks as $taskName => $config) {

ERROR: PossiblyInvalidArgument - src/Configuration/Compiler/TaskCompilerPass.php:79:73 - Argument 1 of array_keys expects array<array-key, mixed>, possibly different type array<array-key, mixed>|non-empty-scalar provided (see https://psalm.dev/092)
        $container->setParameter('grumphp.tasks.configured', array_keys($configuredTasks));

ERROR: PossiblyNullIterator - src/Configuration/Compiler/TestSuiteCompilerPass.php:23:18 - Cannot iterate over nullable var array<array-key, mixed>|null|scalar (see https://psalm.dev/097)
        foreach ($testSuites as $name => $config) {

INFO: RedundantConditionGivenDocblockType - src/Fixer/Provider/FixableProcessResultProvider.php:22:9 - Found a redundant condition when evaluating docblock-defined type $fixerProcess and trying to reconcile type 'Symfony\Component\Process\Process' to Symfony\Component\Process\Process (see https://psalm.dev/156)
        assert($fixerProcess instanceof Process);
veewee commented 3 years ago

Thanks