Skip to content
PHP Ecosystem
Explore

Message

API reference › PHPStan › exception › Message

enumyii2\extensions\phpstan\exception\Message
Backed bystring
Sourcesrc/exception/Message.php

Defines PHPStan extension exception message templates.

Use Message::getMessage() to format the template with sprintf() arguments.

CaseValueDescription
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, a component, nor annotation-based.'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', got '%s'."Error when a configuration value or identifier is not a string.
MethodDescriptionDefined by
getMessage()Returns the formatted message string for the error case.Message
public function getMessage(int|string ...$argument): string

Returns the formatted message string for the error case.

Parameters

ParameterTypeDescription
...$argumentint|stringValues to insert into the message template.

Returns

string: Formatted error message with interpolated arguments.