Remove file doc block #7058
-
|
I'm wondering how to remove file doc blocks like this one: <?php
/*
* @copyright 2014 Mautic Contributors. All rights reserved
* @author Mautic
*
* @link http://mautic.org
*
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
use ...At first I tried to use RemoveAnnotationRector with this config: $services->set(RemoveAnnotationRector::class)->configure(['copyright', 'author', 'license', 'link']);But it does not catch it as it's looking only for classes, methods, properties and constants. Also the file doc blocks do not start with |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Hi Honza, in AST the docs do not exist on their own. They are automatically bound to next node, that can be anything here. To taret the file docs, it's better to go with custom PHP CS Fixer rule and subscribe to |
Beta Was this translation helpful? Give feedback.
Hi Honza,
in AST the docs do not exist on their own. They are automatically bound to next node, that can be anything here.
The same way attributes do not exist without class/property etc.
To taret the file docs, it's better to go with custom PHP CS Fixer rule and subscribe to
T_DOC/COMMENTtokens.Detect the content by obvious markers and remove it.