rector: Fail to execute rector through docker

Question

I’m trying to install and run rector on a symfony4.4 project but failing to get anything out of it šŸ˜• Here is the output of the command execution :

$ docker run -v $(pwd):/project rector/rector:latest process src --set symfony-constructor-injection          
Rector 0.8.x-dev@463dccb

   0/642 [ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘]   0%
  32/642 [ā–“ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘]   4%
  64/642 [ā–“ā–“ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘]   9%
  96/642 [ā–“ā–“ā–“ā–“ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘]  14%
 128/642 [ā–“ā–“ā–“ā–“ā–“ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘]  19%
 160/642 [ā–“ā–“ā–“ā–“ā–“ā–“ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘]  24%
 192/642 [ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘]  29%
 224/642 [ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘]  34%
 320/642 [ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘]  49%
 384/642 [ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘]  59%
 512/642 [ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘]  79%
 608/642 [ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–‘ā–‘]  94%
 642/642 [ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“ā–“] 100%

 [ERROR] Could not process                                                      
         "src/Testing/PHPUnit/AbstractFileSystemRectorTestCase.php" file, due   
         to:                                                                    
         "Analyze error: "Class PHPUnit\Framework\TestCase not found and could  
         not be autoloaded.". Include your files in "parameters >               
         autoload_paths".                                                       
         See https://github.com/rectorphp/rector#extra-autoloading".            

 [ERROR] Could not process                                                      
         "src/Testing/PHPUnit/AbstractGenericRectorTestCase.php" file, due to:  
         "Analyze error: "Class PHPUnit\Framework\TestCase not found and could  
         not be autoloaded.". Include your files in "parameters >               
         autoload_paths".                                                       
         See https://github.com/rectorphp/rector#extra-autoloading".            

 [ERROR] Could not process "src/Testing/PHPUnit/AbstractNodeVisitorTestCase.php"
         file, due to:                                                          
         "Analyze error: "Class PHPUnit\Framework\TestCase not found and could  
         not be autoloaded.". Include your files in "parameters >               
         autoload_paths".                                                       
         See https://github.com/rectorphp/rector#extra-autoloading".            

 [ERROR] Could not process "src/Testing/PHPUnit/AbstractRectorTestCase.php"     
         file, due to:                                                          
         "Analyze error: "Class PHPUnit\Framework\TestCase not found and could  
         not be autoloaded.". Include your files in "parameters >               
         autoload_paths".                                                       
         See https://github.com/rectorphp/rector#extra-autoloading".            

 [ERROR] Could not process                                                      
         "src/Testing/PHPUnit/AbstractRunnableRectorTestCase.php" file, due to: 
         "Analyze error: "Class PHPUnit\Framework\TestCase not found and could  
         not be autoloaded.". Include your files in "parameters >               
         autoload_paths".                                                       
         See https://github.com/rectorphp/rector#extra-autoloading".            

Any hint/help appreciated! Note: we do not have phpunit installed for this project.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 20 (9 by maintainers)

Commits related to this issue

Most upvoted comments

thanks a lot @holtkamp , it works indeed!

@kbsali

Same error, I have to run inside container bash shell:

docker run -it --rm -v $(pwd):/project --entrypoint "/bin/bash" rector/rector:latest
cd /project
/rector/bin/rector process app --set laravel-static-to-injection --dry-run