Menu
← Back to all error identifiers
Error Identifiers: new.*
There are 21 error identifiers in the new.* group:
-
Instantiating an abstract class.
-
Invalid date string passed to the DateTime constructor.
-
Invalid date string passed to the DateTimeImmutable constructor.
-
new.deprecatedClass phpstan-deprecation-rulesInstantiating a deprecated class.
-
new.deprecatedEnum phpstan-deprecation-rulesReferencing a deprecated enum in an instantiation context.
-
new.deprecatedInterface phpstan-deprecation-rulesInstantiating a class that implements a deprecated interface.
-
new.deprecatedTrait phpstan-deprecation-rulesInstantiating a class that uses a deprecated trait.
-
Enums cannot be instantiated with the new keyword.
-
Interfaces cannot be instantiated.
-
Instantiating a class marked as @internal from outside its package.
-
Referencing an internal enum in an instantiation context.
-
Instantiating a class that implements an internal interface.
-
Referencing an internal trait from another package in a new expression.
-
Class without a constructor is instantiated with arguments.
-
Instantiating a class with a private constructor from outside the class.
-
Instantiating a class with a protected constructor from outside the class hierarchy.
-
Object instantiation on a separate line has no effect when the constructor is pure.
-
Unsafe usage of new static() in a non-final class.
-
Using new static() in a static method of an abstract class.
-
Generic template types of a constructor cannot be resolved from the provided arguments.
-
Result of a new expression is used in a context where it evaluates to void.