PHP code example of remp / crm-rector

1. Go to this page and download the library: Download remp/crm-rector 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/ */

    

remp / crm-rector example snippets




declare(strict_types=1);

use Crm\Utils\Rector\Set\CrmSetList;
use Rector\Config\RectorConfig;
use Rector\Core\Configuration\Option;

return static function (RectorConfig $rectorConfig): void {
    $parameters = $rectorConfig->parameters();

    // paths to refactor
    $rectorConfig->paths([
        __DIR__ . '/app/custom-modules', // path to custom modules
         __DIR__ . '/composer.json', // root composer -> updates REMP CRM packages automatically
    ]);

    // optional settings to automatically import namespaces in changed files
    $rectorConfig->importNames();
    $rectorConfig->disableImportShortClasses();

    // set with CRM 1.0 changes; check README for list of sets
    $rectorConfig->sets([
        CrmSetList::CRM_1_0,
    ]);

    // set service if you want to run individual rule; check README for list of rules
    // $services = $rectorConfig->services();
    // $services->set(\Crm\Utils\Rector\UpgradeToCrm1\ApiHandlerJsonResponseRector::class);
};

  $rectorConfig->sets([
      CrmSetList::CRM_3_0_PSR4,
  ]);