Reputation: 360
Suppose I have the following class:
namespace Acme\SuperBundle\Resources;
use \DOMDocument;
/**
* Class XMLAnswerParser
* @package Acme\SuperBundle\Resources
* @author Quant
* @param \DOMDocument $dom
*/
class XMLAnswerParser
{
public $dom;
private $profile;
// a whole lot of things
protected function checkDOM()
{
$this->dom->
And I'd expect any IDE to give me hinting knowing that the $dom property is a DOMDocument. Somehow this is not working in my IDE phpstorm. Am I doing something wrong with the documentation of the class?
The code contains no errors, in case you'd ask that.
Upvotes: 0
Views: 1125
Reputation: 3844
Add
namespace Acme\SuperBundle\Resources;
use \DOMDocument;
/**
* Class XMLAnswerParser
* @package Acme\SuperBundle\Resources
* @author Quant
*/
class XMLAnswerParser
{
/**
* @var \DOMDocument $dom
*/
public $dom;
private $profile;
// a whole lot of things
protected function checkDOM()
{
$this->dom->
Then the IDE will know what $dom exatctly is.
Upvotes: 1
Reputation: 360
<?php
/**
* @var DOMDocument $dom
*/
public $dom
?>
Was the way to do it!
Upvotes: 4