# Message

> Represents the message templates of the exceptions thrown by the scaffold plugin.

[API reference](/docs/api/index.md) › [Scaffold](/docs/extensions/scaffold/reference/index.md) › [Exception](/docs/extensions/scaffold/reference/exception/index.md) › Message

| enum | `PHPForge\Scaffold\Exception\Message` |
| --- | --- |
| Uses traits | [`PHPForge\Scaffold\MessageTemplate`](/docs/extensions/scaffold/reference/messagetemplate/index.md) |
| Backed by | `string` |
| Source | [`src/Exception/Message.php`](https://github.com/php-forge/scaffold/blob/main/src/Exception/Message.php#L12) |

Represents the message templates of the exceptions thrown by the scaffold plugin.

## Cases

| Case | Value | Description |
| --- | --- | --- |
| <span id="case-CONFIG_MANIFEST_INVALID_JSON"></span>`CONFIG_MANIFEST_INVALID_JSON` | `'Project manifest "%s" is not valid JSON: %s.'` | Error when the project manifest is not valid JSON. |
| <span id="case-CONFIG_MANIFEST_NOT_FOUND"></span>`CONFIG_MANIFEST_NOT_FOUND` | `'Project manifest "%s" not found.'` | Error when the project manifest does not exist. |
| <span id="case-CONFIG_MANIFEST_NOT_OBJECT"></span>`CONFIG_MANIFEST_NOT_OBJECT` | `'Project manifest "%s" does not contain a JSON object.'` | Error when the project manifest does not decode to a JSON object. |
| <span id="case-CONFIG_MANIFEST_UNREADABLE"></span>`CONFIG_MANIFEST_UNREADABLE` | `'Could not read project manifest "%s".'` | Error when the project manifest cannot be read. |
| <span id="case-FILESYSTEM_FAILED"></span>`FILESYSTEM_FAILED` | `'%s Reason: %s.'` | Error when a native filesystem call fails, followed by the PHP warning it raised. |
| <span id="case-LOCK_CONFLICT_MARKERS"></span>`LOCK_CONFLICT_MARKERS` | `'Lock file "%s" contains Git conflict markers and is not valid JSON (%s). Resolve the ' . 'merge conflict and run the command again.'` | Error when the lock file holds Git conflict markers and is not valid JSON. |
| <span id="case-LOCK_ENCODE_FAILED"></span>`LOCK_ENCODE_FAILED` | `'Could not encode lock file "%s": %s.'` | Error when the lock file contents cannot be encoded as JSON. |
| <span id="case-LOCK_HASH_FAILED"></span>`LOCK_HASH_FAILED` | `'Could not hash file "%s".'` | Error when a file cannot be hashed. |
| <span id="case-LOCK_INVALID_JSON"></span>`LOCK_INVALID_JSON` | `'Lock file "%s" is not valid JSON: %s.'` | Error when the lock file is not valid JSON. |
| <span id="case-LOCK_MODE_UNKNOWN"></span>`LOCK_MODE_UNKNOWN` | `'Unknown mode "%s" in scaffold-lock.json.'` | Error when a lock entry records an unknown mode. |
| <span id="case-LOCK_NOT_OBJECT"></span>`LOCK_NOT_OBJECT` | `'Lock file "%s" does not contain a valid JSON object.'` | Error when the lock file does not decode to a JSON object. |
| <span id="case-LOCK_UNREADABLE"></span>`LOCK_UNREADABLE` | `'Could not read lock file "%s".'` | Error when the lock file cannot be read. |
| <span id="case-LOCK_UNWRITABLE"></span>`LOCK_UNWRITABLE` | `'Could not write lock file "%s".'` | Error when the lock file cannot be written. |
| <span id="case-MANIFEST_COPY_EMPTY"></span>`MANIFEST_COPY_EMPTY` | `'Manifest "copy" must declare at least one path.'` | Error when the manifest `copy` list is empty. |
| <span id="case-MANIFEST_COPY_ENTRY_INVALID"></span>`MANIFEST_COPY_ENTRY_INVALID` | `'Manifest "copy" entries must be either a string or an object with "from" and ' . '"to" keys.'` | Error when a manifest `copy` entry is neither a string nor a `from`/`to` object. |
| <span id="case-MANIFEST_COPY_ENTRY_NOT_FOUND"></span>`MANIFEST_COPY_ENTRY_NOT_FOUND` | `'Scaffold copy entry "%s" does not exist under provider root "%s".'` | Error when a manifest `copy` entry does not exist under the provider root. |
| <span id="case-MANIFEST_COPY_MISSING"></span>`MANIFEST_COPY_MISSING` | `'Manifest is missing required key "copy" or it is not an array.'` | Error when the manifest lacks the `copy` key or it is not an array. |
| <span id="case-MANIFEST_COPY_NOT_LIST"></span>`MANIFEST_COPY_NOT_LIST` | `'Manifest "copy" must be a sequential list of entries, not an associative object.'` | Error when the manifest `copy` value is an associative object instead of a list. |
| <span id="case-MANIFEST_ENTRY_ABSOLUTE"></span>`MANIFEST_ENTRY_ABSOLUTE` | `'Manifest "%s" entry "%s" must be a relative path.'` | Error when a manifest path entry is absolute. |
| <span id="case-MANIFEST_ENTRY_EMPTY"></span>`MANIFEST_ENTRY_EMPTY` | `'Manifest "%s" entries must be non-empty strings.'` | Error when a manifest path entry is not a non-empty string. |
| <span id="case-MANIFEST_ENTRY_TRAVERSAL"></span>`MANIFEST_ENTRY_TRAVERSAL` | `'Manifest "%s" entry "%s" must not contain path traversal segments.'` | Error when a manifest path entry contains traversal segments. |
| <span id="case-MANIFEST_EXCLUDE_NOT_ARRAY"></span>`MANIFEST_EXCLUDE_NOT_ARRAY` | `'Manifest "exclude" must be an array when present.'` | Error when the manifest `exclude` value is not an array. |
| <span id="case-MANIFEST_KEY_UNKNOWN"></span>`MANIFEST_KEY_UNKNOWN` | `'Manifest contains unknown key "%s". Allowed keys: %s.'` | Error when the manifest declares an unknown key. |
| <span id="case-MANIFEST_MAP_NOT_OBJECT"></span>`MANIFEST_MAP_NOT_OBJECT` | `'Manifest "%s" must be an object when present.'` | Error when the manifest `modes` or `merge` key is not an object. |
| <span id="case-MANIFEST_MAP_VALUE_INVALID"></span>`MANIFEST_MAP_VALUE_INVALID` | `'Manifest "%s" value for pattern "%s" has invalid %s "%s". Allowed: %s.'` | Error when a manifest `modes` or `merge` value is not one of the allowed values. |
| <span id="case-MANIFEST_MAP_VALUE_NOT_STRING"></span>`MANIFEST_MAP_VALUE_NOT_STRING` | `'Manifest "%s" value for pattern "%s" must be a string.'` | Error when a manifest `modes` or `merge` value is not a string. |
| <span id="case-MANIFEST_PROVIDER_FILE_NOT_FOUND"></span>`MANIFEST_PROVIDER_FILE_NOT_FOUND` | `'Provider "%s": %s not found at "%s".'` | Error when a provider file does not exist. |
| <span id="case-MANIFEST_PROVIDER_FILE_NOT_OBJECT"></span>`MANIFEST_PROVIDER_FILE_NOT_OBJECT` | `'Provider "%s": %s "%s" must decode to an object.'` | Error when a provider file does not decode to a JSON object. |
| <span id="case-MANIFEST_PROVIDER_FILE_UNREADABLE"></span>`MANIFEST_PROVIDER_FILE_UNREADABLE` | `'Provider "%s": could not read %s "%s".'` | Error when a provider file cannot be read. |
| <span id="case-MANIFEST_REFERENCE_EMPTY"></span>`MANIFEST_REFERENCE_EMPTY` | `'Provider "%s": "manifest" must be a non-empty string.'` | Error when the provider `manifest` reference is not a non-empty string. |
| <span id="case-MANIFEST_REFERENCE_NOT_RELATIVE"></span>`MANIFEST_REFERENCE_NOT_RELATIVE` | `'Provider "%s": "manifest" must be a relative path inside the provider ' . 'root.'` | Error when the provider `manifest` reference points outside the provider root. |
| <span id="case-MODE_COPY_FAILED"></span>`MODE_COPY_FAILED` | `'Could not copy "%s" to "%s".'` | Error when a source file cannot be copied to its destination. |
| <span id="case-MODE_DESTINATION_UNREADABLE"></span>`MODE_DESTINATION_UNREADABLE` | `'Could not read destination file "%s".'` | Error when the destination file cannot be read. |
| <span id="case-MODE_SOURCE_UNREADABLE"></span>`MODE_SOURCE_UNREADABLE` | `'Could not read source file "%s".'` | Error when the source file cannot be read. |
| <span id="case-MODE_WRITE_FAILED"></span>`MODE_WRITE_FAILED` | `'Could not write to "%s".'` | Error when the destination file cannot be written. |
| <span id="case-PACKAGE_NOT_ALLOWED"></span>`PACKAGE_NOT_ALLOWED` | `'Package "%s" is not authorized to scaffold files. Add it to ' . 'extra.scaffold.allowed-packages.'` | Error when a package is not in the scaffold allowlist. |
| <span id="case-PATH_ABSOLUTE"></span>`PATH_ABSOLUTE` | `'Absolute path is not allowed in %s: "%s".'` | Error when a path is absolute. |
| <span id="case-PATH_DIRECTORY_CREATE_FAILED"></span>`PATH_DIRECTORY_CREATE_FAILED` | `'Could not create directory "%s".'` | Error when a directory cannot be created. |
| <span id="case-PATH_PROJECT_ROOT_INACCESSIBLE"></span>`PATH_PROJECT_ROOT_INACCESSIBLE` | `'Project root does not exist or is not accessible: "%s".'` | Error when the project root does not exist or is not accessible. |
| <span id="case-PATH_PROVIDER_ROOT_INACCESSIBLE"></span>`PATH_PROVIDER_ROOT_INACCESSIBLE` | `'Provider root does not exist or is not accessible: "%s".'` | Error when the provider root does not exist or is not accessible. |
| <span id="case-PATH_RESERVED"></span>`PATH_RESERVED` | `'Destination "%s" is reserved for the scaffold lock file.'` | Error when a destination addresses the scaffold lock file. |
| <span id="case-PATH_SYMLINK_ESCAPE"></span>`PATH_SYMLINK_ESCAPE` | `'%s path escapes the root via symlink: "%s".'` | Error when a path escapes its root through a symlink. |
| <span id="case-PATH_SYMLINK_UNRESOLVABLE"></span>`PATH_SYMLINK_UNRESOLVABLE` | `'%s path is a symlink that cannot be resolved: "%s".'` | Error when a symlink in a path cannot be resolved. |
| <span id="case-PATH_TRAVERSAL"></span>`PATH_TRAVERSAL` | `'Path traversal detected in %s: "%s".'` | Error when a path contains traversal segments. |
| <span id="case-PROVIDER_INSTALL_PATH_MISSING"></span>`PROVIDER_INSTALL_PATH_MISSING` | `'Provider "%s" has no install path.'` | Error when a resolved provider has no install path. |
| <span id="case-REGEX_FAILED"></span>`REGEX_FAILED` | `'Regular expression failed: %s.'` | Error when a PCRE function fails. |
| <span id="case-SCAFFOLD_ABORTED"></span>`SCAFFOLD_ABORTED` | `'[scaffold] Scaffolding aborted: %s'` | Error when the scaffold workflow aborts on an unexpected failure. |
| <span id="case-SCAFFOLD_FILES_FAILED"></span>`SCAFFOLD_FILES_FAILED` | `'[scaffold] %d %s while scaffolding; see the messages above.'` | Error when one or more files fail while scaffolding. |
| <span id="case-SCAFFOLD_FRAGMENT_FAILED_FILE"></span>`SCAFFOLD_FRAGMENT_FAILED_FILE` | `'file failed'` | Fragment that names a single failed file. |
| <span id="case-SCAFFOLD_FRAGMENT_FAILED_FILES"></span>`SCAFFOLD_FRAGMENT_FAILED_FILES` | `'files failed'` | Fragment that names several failed files. |
| <span id="case-SCAFFOLD_MANIFEST_LOAD_FAILED"></span>`SCAFFOLD_MANIFEST_LOAD_FAILED` | `'[scaffold] Failed to load manifest for "%s": %s'` | Error when a provider manifest cannot be loaded. |
| <span id="case-SERVICE_CURRENT_FILE_UNREADABLE"></span>`SERVICE_CURRENT_FILE_UNREADABLE` | `'Could not read current file "%s".'` | Error when the current project file cannot be read. |
| <span id="case-SERVICE_STATUS_ENCODE_FAILED"></span>`SERVICE_STATUS_ENCODE_FAILED` | `'Could not encode the status report: %s.'` | Error when the status report cannot be encoded as JSON. |
| <span id="case-SERVICE_STUB_NOT_FOUND"></span>`SERVICE_STUB_NOT_FOUND` | `'Stub not found: "%s".'` | Error when a provider stub does not exist. |
| <span id="case-SERVICE_STUB_UNREADABLE"></span>`SERVICE_STUB_UNREADABLE` | `'Could not read stub "%s".'` | Error when a provider stub cannot be read. |