1. Go to this page and download the library: Download mrpunyapal/rector-pest library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mrpunyapal / rector-pest example snippets
// rector.php
use RectorPest\Set\PestSetList;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withPaths([
__DIR__ . '/tests',
])
->withSets([
PestSetList::PEST_CODE_QUALITY,
]);
// rector.php
use RectorPest\Set\PestLevelSetList;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withPaths([
__DIR__ . '/tests',
])
->withSets([
PestLevelSetList::UP_TO_PEST_40,
]);
// rector.php
use RectorPest\Set\PestSetList;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withPaths([
__DIR__ . '/tests',
])
->withSets([
PestSetList::PEST_30, // Only v2→v3 changes
]);
// rector.php
use RectorPest\Set\PestSetList;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withPaths([
__DIR__ . '/tests',
])
->withSets([
PestSetList::PEST_CODE_QUALITY,
PestSetList::PEST_CHAIN,
]);