worksome/coding-style

ArraySpreadInsteadOfArrayMergeRector error

Closed this issue · 2 comments

sojeda commented

Hi! I was using this package, and when I executed 'composer update' and ran 'rector', the following message/error appeared:

╰─❯ vendor/bin/rector process --ansi --vvv                                                                                                             ─╯
                                                                                                                        
 [ERROR] Expected an existing class name. Got: "Rector\Php74\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector"     

Any ideas?

Versions:
worksome/coding-style 2.6.1
rector/rector 0.18.10

rector.php

<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\SetList;
use Worksome\CodingStyle\WorksomeRectorConfig;

return static function (RectorConfig $rectorConfig): void {
    WorksomeRectorConfig::setup($rectorConfig);

    $rectorConfig->paths([
        __DIR__ . '/app',
        __DIR__ . '/tests',
    ]);

    // Define extra rule sets to be applied
    $rectorConfig->sets([
        SetList::DEAD_CODE,
    ]);

    // Register extra a single rules
    // $rectorConfig->rule(ClassOnObjectRector::class);
};
sojeda commented

Update: I found the error the error in WorksomeRectorConfig.php

use Rector\CodingStyle\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector;

instead of use Rector\Php74\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector;

This has been resolved in the v2.6.2, apologies I hadn't seen your message. I'm now subscribed to the issues here. 👍🏻