Menu
Error Identifier: new.nonObject
Every error reported by PHPStan has an error identifier. Here’s a list of all error identifiers. In PHPStan Pro you can see the error identifier next to each error and filter errors by their identifiers.
Error identifiers like new.nonObject in PHPStan can be used to ignore errors locally using a comment:
// @phpstan-ignore new.nonObject
codeThatProducesTheError();
You can also use only the identifier key to ignore all errors of the same type in your configuration file in the ignoreErrors parameter:
parameters:
ignoreErrors:
-
identifier: new.nonObject
Rules that report this error #
- PHPStan\Rules\Classes\InstantiationRule [1]