Inspectopedia Help

ObjectShape can be added

Reports public properties of an object with specified types. Suggests specifying the shape of the returned object via the #[ObjectShape] attribute or an object shape in the PHPDoc comment.


$a = new stdClass(); $a->name = "name"; $a->age = 2;

After the quick-fix is applied:

/** @var $a object{name: string, age: int} */ $a = new stdClass(); $a->name = "name"; $a->age = 2;

Inspection Details

By default bundled with:

PhpStorm 2024.1, Qodana for PHP 2024.1,

Can be installed with plugin:


Last modified: 29 April 2024