Based on your sample code, it is best to use the $requestParams type stdClass via @var . Your use of @property will not do anything for you, because this tag is defined only for magic properties existing in the class ... therefore, @property will be read and interpreted only when it is in the docblock class.
If you only need to show that $ requestParams is an instance of stdClass, then @var is all you need. However, if you want to point out once again that $ requestParams-> cancelUrl is a known string property, without changing it to the actual specific class, you will have to use another local variable in the same way that $ requestParams is a local variable:
$requestParams = $someObj->getSomething(); $cancelUrl = $requestParams->cancelUrl;
Besides the answer to your direct question - if it is really important for you to show your readers that this element of $ requestParams has certain specific properties, I would choose a formal class for it. An implementation in this class can still be just an internal stdClass for storing values, of course.
source share