JMSTranslationBundle注释" @ optional"在财产从未进口过。您是否忘记添加"使用"这个注释的陈述?

时间:2018-05-19 07:00:40

标签: php symfony annotations

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

$('#select_id').select2({ minimumResultsForSearch: -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?

1 个答案:

答案 0 :(得分:0)

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

use Doctrine\Common\Annotations\Annotation\IgnoreAnnotation;

/**
  * @IgnoreAnnotation("created")
  * @IgnoreAnnotation("optional")
  */