/* @var ClassName $object */
is a non-valid PHPDOC comment and is not parsed in the current version of Web IDE. Use double asterisks to make it work:
/** @var ClassName $object */
Also, you can annotate $array
in foreach($array as $var)
with /** @var ClassName[] $array */
and $var
type will be deduced automatically.
Related Contents:
- How do you debug PHP scripts? [closed]
- Cannot pass null argument when using type hinting
- How to resolve “must be an instance of string, string given” prior to PHP 7?
- Nullable return types in PHP7
- How can I set the PHP version in PHPStorm?
- Wrong syntax highlighting for PHP file in PHPStorm
- Exclude folder from search but not from the project list
- Why I am suddenly getting a “Typed property must not be accessed before initialization” error when introducing properties type hints?
- How to make PHPStorm collapsing all methods/functions on file open?
- Type hinting in PHP 7 – array of objects
- How can I catch a “catchable fatal error” on PHP type hinting?
- Type hinting for properties in PHP 7?
- How to document magic (_call and _callStatic) methods for IDEs
- How to stop xdebug from stopping on first line with PhpStorm?
- PHP 7 interfaces, return type hinting and self
- How to search a file in PhpStorm?
- Make PhpStorm stop automatically closing tabs
- Is it possible to specify multiple return types on PHP 7?
- PHP: bool vs boolean type hinting
- PhpStorm how to refresh folder content or whole project tree
- PHP type-hinting to primitive values?
- PhpStorm Field accessed via magic method
- How to wrap selection in quotes using PhpStorm?
- SQL Dialect is Not Configured (Phpstorm)
- Is it possible to get Ruby syntax highlighting in PHPStorm?
- Is it possible to type hint more than one type?
- How do I make my PHP IDE understand Dependency Injection Containers?
- PhpStorm find all deprecated usages in the project
- Iterable objects and array type hinting?
- Disable PHPStorm new file branding
- How to display “git blame” in PhpStorm after opening file by default
- Type hinting for any object
- How to deal with “method not found in class” warning for magically implemented methods?
- PHPStorm is not recognizing methods of my Model class in Laravel 5.0 [duplicate]
- How to configure “Directories” when using a Symfony project in PhpStorm
- how to align text to specific character in phpstorm or webstorm?
- PhpStorm debugger not stopping at BreakPoints; keeps waiting for xdebug _SESSION_
- Type Hinting: Default Parameters
- PHPStorm: undefined variables caused by include/require
- How to convert JSON string to array
- How to replace “if” statement with a ternary operator ( ? : )?
- PHP – iterate on string characters
- Why PHP Trait can’t implement interfaces?
- How to verify if my postfix uses really TLS to send outgoing mails?
- How to get a platform independent directory separator in PHP?
- Use Javascript to access a variable passed through Twig
- Laravel 5.3 date validator: equal to or after start_date
- Access MAMP’s MySQL from Terminal
- ImageMagick vs GD – which is faster, less resource intensive and produces better images?
- How can I make short random unique keys, like YouTube video IDs, in PHP? [closed]