-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Description
What needs to be done?
Create a new exception class ResourceAlreadyExistsException that extends the base Exception class. This class must have a constructor with three parameters:
entityName(string) — the name of the entity.resourceType(of typeResourceTypeEnum) — the type of resource.entityNamespace(string|null) — optional, default value isnull.
The constructor should automatically set the exception message using the template:Cannot create {$entity}{$resourceType} cause it already exists. Remove {$entity}{$resourceType} and run command again.
Also, create an enum class ResourceTypeEnum inside the src/Enums directory with the following cases:
Controller
Factory
Model
NovaResource
NovaTest
Resource
CollectionResource
Ensure proper usage of the enum type for the $resourceType argument in the exception class constructor.