首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >JMSTranslationBundle从未导入属性中的注释"@optional“。您是否忘记了为此注释添加"use“语句?

JMSTranslationBundle从未导入属性中的注释"@optional“。您是否忘记了为此注释添加"use“语句?
EN

Stack Overflow用户
提问于 2018-05-19 15:00:40
回答 1查看 131关注 0票数 0

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

代码语言:javascript
复制
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?

可以忽略未知的注解吗?

代码语言:javascript
复制
 "jms/translation-bundle": "^1.3",
    "nikic/php-parser": "v1.4.1",
EN

回答 1

Stack Overflow用户

发布于 2018-05-19 15:51:01

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

代码语言:javascript
复制
use Doctrine\Common\Annotations\Annotation\IgnoreAnnotation;

/**
  * @IgnoreAnnotation("created")
  * @IgnoreAnnotation("optional")
  */
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50422686

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档