Lines
0.00%
0 / 15
Methods
0.00%
0 / 1
Classes
0.00%
0 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| messageTemplate | 0.00% | 0 / 15 | 0.00% | 0 / 1 | 240 | ||
| 9 | enum AppError: string implements ExceptionReason | |
| 10 | { | |
| 11 | case DuplicateId = 'duplicate_id'; | |
| 12 | case DirectoryNotAutoloadable = 'directory_not_autoloadable'; | |
| 13 | case NotAnApp = 'not_an_app'; | |
| 14 | case NotInstantiable = 'not_instantiable'; | |
| 15 | case IdInvalid = 'id_invalid'; | |
| 16 | case InitializeTimedOut = 'initialize_timed_out'; | |
| 17 | case Unknown = 'unknown'; | |
| 18 | case Disabled = 'disabled'; | |
| 19 | case TemplateAndAutomation = 'template_and_automation'; | |
| 20 | case InstanceClassMissing = 'instance_class_missing'; | |
| 21 | case InstanceClassNotMarked = 'instance_class_not_marked'; | |
| 22 | case InstanceIdTaken = 'instance_id_taken'; | |
| 23 | case InstanceIdsCollide = 'instance_ids_collide'; | |
| 24 | case GeneratedCodeFromOlderMajor = 'generated_code_from_older_major'; | |
| 25 | ||
| 26 | public function messageTemplate(): string | |
| 27 | { | |
| 28 | return match ($this) { | |
| 29 | self::DuplicateId => 'Automations {firstClass} and {secondClass} both use ID "{appId}"; "-" and "_" count as the same character.', | |
| 30 | self::DirectoryNotAutoloadable => '{directory} is not covered by a PSR-4 autoload rule. Add it to "autoload" in composer.json and run `make install`.', | |
| 31 | self::NotAnApp => '{className} has {attribute} but does not implement {appInterface}.', | |
| 32 | self::NotInstantiable => '{className} has {attribute} but cannot be instantiated.', | |
| 33 | self::IdInvalid => '{className}: automation ID "{appId}" is invalid; use lowercase letters, digits, "-" and "_", starting with a letter.', | |
| 34 | self::InitializeTimedOut => '{appId} initialize() did not return within {timeout}. Raise supervision.initialize_timeout if needed.', | |
| 35 | self::Unknown => 'No automation with ID "{appId}".', | |
| 36 | self::Disabled => 'Automation "{appId}" is not loaded because apps.{appId}.enabled is false.', | |
| 37 | self::TemplateAndAutomation => '{className} has both #[Automation] and #[AppTemplate]; keep #[Automation] to run it under its own ID, or #[AppTemplate] to run it only through apps.<id>.class.', | |
| 38 | self::InstanceClassMissing => 'apps.{appId}.class names {className}, which does not exist.', | |
| 39 | self::InstanceClassNotMarked => 'apps.{appId}.class names {className}, which has neither #[AppTemplate] nor #[Automation].', | |
| 40 | self::InstanceIdTaken => 'apps.{appId}.class runs {className} under "{appId}", which is already the ID of automation {takenBy}.', | |
| 41 | self::InstanceIdsCollide => 'apps.{appId} and apps.{otherAppId} both name a class, and "-" and "_" count as the same character.', | |
| 42 | self::GeneratedCodeFromOlderMajor => '{namespace} was generated by Stewart {major}.x; run `stewart generate`.', | |
| 43 | }; | |
| 44 | } | |
| 45 | } |