简体   繁体   English

缺少“@var 注释”,Typo3

[英]missing "@var annotation", Typo3

I've got a problem with an extension in Typo3.我在 Typo3 中遇到了扩展问题。 My problem: An uncaught Typo3-Exception:我的问题:未捕获的 Typo3-Exception:

There is no @var annotation for property "enigma" in class "In2\Femanager\Domain\Model\User"

The exception is an "InvalidArgumentException" thrown by "...__core/typo3_src-6.2.15/typo3/sysext/extbase/Classes/Validation/ValidatorResolver.php".异常是“...__core/typo3_src-6.2.15/typo3/sysext/extbase/Classes/Validation/ValidatorResolver.php”抛出的“InvalidArgumentException”。 Looking into the code of Femanager/Domain/Model/User.php, there is a line查看Femanager/Domain/Model/User.php的代码,有一行

protected $enigma;

but without any但没有任何

/**
* @var $enigma Enigma
*/

the variable $enigma is later filled by an object of the type "Enigma".变量 $enigma 后来被一个“Enigma”类型的对象填充。 But if I add this part, nothing happens.但是如果我添加这部分,什么也不会发生。 Anyone got an idea on how to solve this?任何人都知道如何解决这个问题?

As per PHP doc for var states you need to place the type prior to the variable name.根据关于var状态的 PHP 文档,您需要将类型放在变量名之前。

That is:那是:

@var Enigma $engima

Not:不是:

@var $engima Enigma 

Also;还; You may need to reload the op-code cache.您可能需要重新加载操作码缓存。 (OpCache or the like). (OpCache 等)。

Another possible solution is to disable the validation somehow, until your dev can get back it.另一种可能的解决方案是以某种方式禁用验证,直到您的开发人员可以取回它。 (Maybe comment it out, seems complicated to predict the full effect but maybe worth a try if the repercussions of being down outweigh the risk) (也许可以评论一下,预测全部效果似乎很复杂,但如果情绪低落的影响超过风险,也许值得一试)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM