How to use rector with Yii2?


I trying to run rector on my yii2-app-advanced based code, but got errors.

the steps i done:
git clone
cd yii2-app-advanced
composer install
I am using rector with phpqa
phpqa rector process common/ --level code-quality

[ERROR] Could not process "/project/common/fixtures/UserFixture.php" file, due to: "Analyze error: "Class common\fixtures\UserFixture was not found while trying to analyse it - autoloading is probably not configured properly.". Include your files in "parameters > autoload_paths". See".

new test with autoload-file
phpqa rector process common/ --level code-quality --autoload-file vendor/autoload.php

got same errors.
can someone please help me with this?

Ok, i figured it out.
I had to setup the autoload_paths in rector.yaml as this:

# rector.yaml
    - 'vendor/*'
    - '.'
1 Like

I always thought phpqa is just a listing of projects, not a tool :slight_smile: