I'm trying to resolve
"Field 'stdout' not found in ..."
and
"Method ... not found in array"
warning using PHPDocumentor notations @property and @method on PhpStorm
I was able to resolve the warning for stdout using:
* @property array stdout
But now how do you resolve the Method 'styles' not found in array warning? (See screenshot above)
I made up this code to demonstrate what I'm trying to achieve:
* @method array $stdout->styles(array $name, array $items)
This is a CakePhp 2 project using CakePhp's Command Shell.
stdout->styles is declared in the framework.
For more context this is what my code looks like:
<?
class InvoiceShell extends AppShell {
public $uses = array('Invoice', 'Request');
public function main() {
$this->stdout->styles('success', ['text' => 'green']);
$this->stdout->styles('danger', ['text' => 'red']);
$this->stdout->styles('bold', ['bold' => true]);
.
.
.
}
}


stdout? 2) How it's declared? 3) if it's used likestdout->styles.. then why are you trying to declarestdoutas array (when it's clearly an object here)? 3)* @method array $stdout->styles(array $name, array $items)-- completely wrong -- you cannot declare sub-property/sub-method this way -- only direct elements. This means (using your example)* @method array styles(array $name, array $items)at best (which is still wrong for your case -- but this is just to illustrate the right syntax).stdoutandstylesare defined in the CakePHP framework. It is outside of my control.stdoutis? What type is it? Because you can easily use* @property MyStdoutClass $stdoutand that's it (just use correct class name instead of MyStdoutClass). Unfortunately I'm not CakePHP user so cannot give you 100% correct solution straight away without knowing details. P.S. If you do not know what typestdoutis -- you may try debugging such script -- xdebug will tell what type/class it is.ConsoleOutput.@property ConsoleOutput stdoutworked. If you'd like you can you create an answer out of this and I'll be more than happy to accept as as answer.