PHP code example of rector / swiss-knife

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

    

rector / swiss-knife example snippets


//      foreach ($matches as $match) {
//           $content = str_replace($match[0], $match[2], $content);
//      }
diff
 # file path: src/Repository/TalkRepository.php

-namespace Model;
+namespace App\Repository;

 ...
bash
vendor/bin/swiss-knife finalize-classes src tests --skip-file src/SpecialProxy.php