Skip to content

Why does rector remove code comments? #2863

@alexanderschnitzler

Description

@alexanderschnitzler

Question

Sorry to bother you but after upgrading to rector 0.7.0 I have a different behavior processing files.
It seems that all comments that are formatted like doc blocks and which are not associated with a structure like a property or method are removed and I don't know what rule is causing this exactly.

I am running the php53 set only in this example.

Is it possible to print out which rule(rector) is responsible for a change?

$ ~/Development/TYPO3-development/TYPO3.CMS ±master⚡ » rector process typo3/sysext/backend/Classes/Clipboard/Clipboard.php -vvv --debug --set=php53
File "/home/alexander/Development/TYPO3-development/TYPO3.CMS/vendor/autoload.php" is about to be loaded in "AutoloadIncluder::includeCwdVendorAutoloadIfExists()" on line 63"
File "/home/alexander/composer-packages/rector/rector/vendor/rector/rector/../../autoload.php" is about to be loaded in "AutoloadIncluder::autoloadProjectAutoloaderFile()" on line 95"
File "/home/alexander/Development/TYPO3-development/TYPO3.CMS/vendor/autoload.php" is about to be loaded in "AutoloadIncluder::includeCwdVendorAutoloadIfExists()" on line 63"
File "/home/alexander/composer-packages/rector/rector/vendor/rector/rector/../../autoload.php" is about to be loaded in "AutoloadIncluder::autoloadProjectAutoloaderFile()" on line 95"
Rector v0.7.0
Config file: rector.yml

[parsing] typo3/sysext/backend/Classes/Clipboard/Clipboard.php
[refactoring] typo3/sysext/backend/Classes/Clipboard/Clipboard.php
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector
    [applying] Rector\Php53\Rector\Ternary\TernaryToElvisRector
[printing] typo3/sysext/backend/Classes/Clipboard/Clipboard.php


1 file with changes
===================

1) typo3/sysext/backend/Classes/Clipboard/Clipboard.php

    ---------- begin diff ----------
--- Original
+++ New
@@ -1002,11 +1002,6 @@
         return $CMD;
     }

-    /*****************************************
-     *
-     * FOR USE IN tce_file.php:
-     *
-     ****************************************/
     /**
      * Applies the proper paste configuration in the $file array send to tce_file.php.
      * The current pad is pasted
    ----------- end diff -----------

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions