phpdoc 建议 $this->someField 的类型
在 Netbeans 和 phpStorm 中, 这按预期工作:
public function someMethod() {
$objectA = uberEnterprisyFactory('someclassA');
/* @var $objectA TheClassA */
// $objectA-> (autocomplete for TheClassA is displayed, good)
这不是:
public function someMethod() {
$this->objectA = uberEnterprisyFactory('somemodelA');
/* @var $this->objectA TheClassA */
// $this->objectA-> (no autocomplete here, not good, $this->objectA is inferred to be null)
如何将 $this->someThing
的类型建议给 Netbeans 和/或 phpStorm?
In Netbeans and phpStorm,
this works as expected:
public function someMethod() {
$objectA = uberEnterprisyFactory('someclassA');
/* @var $objectA TheClassA */
// $objectA-> (autocomplete for TheClassA is displayed, good)
This does not:
public function someMethod() {
$this->objectA = uberEnterprisyFactory('somemodelA');
/* @var $this->objectA TheClassA */
// $this->objectA-> (no autocomplete here, not good, $this->objectA is inferred to be null)
How can I sugest type of $this->someThing
to Netbeans and/or phpStorm?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用以下 PHPDoc 注释:
Use the following PHPDoc annotation: