Message
API reference › PHPStan › exception › Message
Defines PHPStan extension exception message templates.
Use Message::getMessage() to format the template with sprintf() arguments.
| Case | Value | Description |
|---|---|---|
BEHAVIOR_DEFINITION_NOT_ARRAY | "Behavior definition for '%s' must be an array." | Error when a behavior definition is not an array. |
BEHAVIOR_METHOD_NOT_FOUND | 'Method %s::%s() is not provided by any behavior attached to the class.' | Error when no attached behavior provides the requested method. |
BEHAVIOR_PROPERTY_NOT_FOUND | 'Property %s::$%s is not provided by any behavior attached to the class.' | Error when no attached behavior provides the requested property. |
CONFIG_FILE_NOT_ARRAY | "Configuration file '%s' must return an array." | Error when the configuration file does not return an array. |
CONFIG_PATH_NOT_READABLE | "Provided config path '%s' must be a readable PHP file." | Error when the provided configuration path is not a readable PHP file. |
CONFIG_SECTION_NOT_ARRAY | "Configuration file '%s' must contain a valid '%s' 'array'." | Error when a configuration file section is not an array. |
PROPERTY_NOT_RESOLVED | 'Property %s::$%s is neither native, | Error when an application property is neither native, a component, nor annotation-based. |
SHAPE_KEY_WITHOUT_VALUE_TYPE | 'Shape key without a value type.' | Error when a constant array shape key has no matching value type. |
UNSUPPORTED_DEFINITION | "Unsupported definition for '%s'." | Error when a service or component definition is unsupported. |
VALUE_NOT_STRING | "'%s': '%s' must be a 'string', | Error when a configuration value or identifier is not a string. |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
getMessage() | Returns the formatted message string for the error case. | Message |
Method details
Section titled “Method details”getMessage()
Section titled “getMessage() ”public function getMessage(int|string ...$argument): stringReturns the formatted message string for the error case.
Parameters
| Parameter | Type | Description |
|---|---|---|
...$argument | int| | Values to insert into the message template. |
Returns
string: Formatted error message with interpolated arguments.