may_cat
may_cat

Reputation: 11

phpDoc for object's properties

I've got file template.php, that is included in CBitrixComponentTemplate's method. CBitrixComponentTemplate has property $this->__component, that is dynamicly filled with object EtmOrderAdd. EtmOrderAdd has property objValidator.

Now, when I am writing the file template.php, I need all these properties to be understood by phpDoc. Here's the picture, illustrating my idea :

enter image description here

How should I write it?

Upvotes: 1

Views: 1314

Answers (1)

nook_ru
nook_ru

Reputation: 31

Bitrix has almost no phpDoc for internal methods and functions. Also it has a plenty of legacy code, that won't show correctly with PhpStorm's code completion.

However, there are several things you can try to improve the situation:

  • Add bxApiDocs files as an External Library to PhpStorm.
    This will add autocomplete for the internal bitrix methods
  • It seems like you've defined custom component class since $template->__component usually contains CBitrixComponent object that doesn't have objValidator property. So you need to add @property inside your class.php file of your component.

Upvotes: 3

Related Questions