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 |
Answered by
TomasVotruba
Mar 16, 2022
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 |
2 replies
Answer selected by
escopecz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.