JMSTranslationBundle属性中的注释“@optional”从未导入。您是否忘记为此注释添加“使用”语句?

问题描述 投票:0回答:1

我尝试提取翻译,但有很多错误

php bin/console translation:extract pt --dir=./src/ --output-dir=./app/Resources/translations

[Semantical Error] The annotation "@created" in class InvoiceBundle\Service\CodeGeneratorService was never imported. Did you maybe forget to add a "use" statement for this annotation?

 [Semantical Error] The annotation "@optional" in property Ups\Entity\Tradeability\TariffInfo::$detailId was never imported. Did you maybe forget to add a "use" statement for this annotation?

可以忽略未知的注释吗?

 "jms/translation-bundle": "^1.3",
    "nikic/php-parser": "v1.4.1",
php symfony annotations
1个回答
0
投票

您可以尝试使用Doctrine IgnoreAnnotation,看看它是否符合您的目的。

use Doctrine\Common\Annotations\Annotation\IgnoreAnnotation;

/**
  * @IgnoreAnnotation("created")
  * @IgnoreAnnotation("optional")
  */
© www.soinside.com 2019 - 2024. All rights reserved.