Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Parallel] Add serializable object passing to FileProcessors #1583

Merged
merged 11 commits into from
Dec 28, 2021

Conversation

TomasVotruba
Copy link
Member

@TomasVotruba TomasVotruba commented Dec 27, 2021

@TomasVotruba TomasVotruba changed the title return type to FileProcessor Return type to FileProcessor Dec 27, 2021
@TomasVotruba TomasVotruba changed the title Return type to FileProcessor [Parallel] Add serializable object passing to FileProcessors Dec 28, 2021
@samsonasik
Copy link
Member

samsonasik commented Dec 28, 2021

The diff for no change seems should no need to be displayed (counted), ref https://github.com/rectorphp/rector-src/runs/4648198614?check_suite_focus=true#step:6:34

2) rules-tests/DependencyInjection/Rector/Class_/ActionInjectionToConstructorInjectionRector/xml/services.xml

    ---------- begin diff ----------

    ----------- end diff -----------

                                                                                
 [OK] 2 files have been changed by Rector                                       

@TomasVotruba
Copy link
Member Author

The diff for no change seems should no need to be displayed

I'll check it, thanks for spotting 👍

@TomasVotruba TomasVotruba merged commit bd052a1 into main Dec 28, 2021
@TomasVotruba TomasVotruba deleted the tv-parallel-4 branch December 28, 2021 08:03
@samsonasik
Copy link
Member

It seems surplus new line now:

Run bin/rector process rules --ansi --no-progress-bar

                                                                                
 [OK] Rector is done!                                                           

which should be 1 line instead of 2 between Command and [OK] Rector is done! message.

@samsonasik
Copy link
Member

@TomasVotruba it seems make build scoped error, ref https://github.com/rectorphp/rector-src/runs/4648294686?check_suite_focus=true#step:14:78

Parse error: rector-prefixed-downgraded/vendor/ssch/typo3-rector/src/FileProcessor/FlexForms/FlexFormsProcessor.php:32
    30|     {
    31|         if ([] === $this->flexFormRectors) {
  > 32|             return;
    33|         }
    34|         $domDocument = new \DOMDocument();
A function with return type must return a value in rector-prefixed-downgraded/vendor/ssch/typo3-rector/src/FileProcessor/FlexForms/FlexFormsProcessor.php on line 32
------------------------------------------------------------
Parse error: rector-prefixed-downgraded/vendor/ssch/typo3-rector/src/FileProcessor/Fluid/FluidFileProcessor.php:34
    32|     {
    33|         if ([] === $this->fluidRectors) {
  > 34|             return;
    35|         }
    36|         foreach ($this->fluidRectors as $fluidRector) {
A function with return type must return a value in rector-prefixed-downgraded/vendor/ssch/typo3-rector/src/FileProcessor/Fluid/FluidFileProcessor.php on line 34
------------------------------------------------------------
Parse error: rector-prefixed-downgraded/vendor/ssch/typo3-rector/src/FileProcessor/Yaml/Form/FormYamlFileProcessor.php:41
    39|         // Prevent unnecessary processing
    40|         if ([] === $this->transformer) {
  > 41|             return;
    42|         }
    43|         $this->currentFileProvider->setFile($file);
A function with return type must return a value in rector-prefixed-downgraded/vendor/ssch/typo3-rector/src/FileProcessor/Yaml/Form/FormYamlFileProcessor.php on line 41
------------------------------------------------------------
Parse error: rector-prefixed-downgraded/vendor/rector/rector-nette/src/FileProcessor/NeonFileProcessor.php:44
    42|     {
    43|         if ($this->neonRectors === []) {
  > 44|             return;
    45|         }
    46|         $fileContent = $file->getFileContent();
A function with return type must return a value in rector-prefixed-downgraded/vendor/rector/rector-nette/src/FileProcessor/NeonFileProcessor.php on line 44

@TomasVotruba
Copy link
Member Author

TomasVotruba commented Dec 28, 2021

I see. That's due to change of FileProcessorInterface:

https://github.com/rectorphp/rector-src/pull/1583/files#diff-169c1ccc343b4c5f96ebdf832a9c74b5f61cd3209d4410bfd0739e7eb0bca132

But that's only in the docbocks, so there should not be any BC break 🤔

The FileProcessors in typo3 should be updated to return array of system errors and file diffs. That might help too

@TomasVotruba
Copy link
Member Author

This might help sabbelasichon/typo3-rector#2766

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants