我错误地在我的文件中添加了 DocBlock 注释:
/**
* @author My Name <my@email.com>
* @copyright Copyright (C) 2012 - 2015 My App. All rights reserved.
* @license Some notes about the license.
*/
但这是错误的,因为我希望像这样设置标题注释:
/*
* This file is part of the My App.
*
* Copyright My Name 2012-2016.
*
* This code is to consider private and non disclosable to anyone for whatever reason.
* Every right on this code is reserved.
*
* @author My name <my@email.com>
*/
现在,我添加了标题注释 using PHP-CS-Fixer但是现在,我怎样才能删除旧的?
最佳答案
使用 friendsofphp/php-cs-fixer:^2.0.0
,可以使用以下配置完全删除 header 注释:
$config = PhpCsFixer\Config::create()->setRules([
'header_comment' => [
'header' => '',
],
]);
请注意我们如何提供一个空字符串。
关于PHP-CS-修复程序 : how to remove header DocBlock comments,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40244960/