| Total Complexity | 5 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 5 | class SchemaException extends MappingException |
||
| 6 | { |
||
| 7 | public static function forInvalidEntityClass(string $type): SchemaException |
||
| 8 | { |
||
| 9 | return new self("Cannot initialize schema for the class ${type}. ${type} must be instance of Entity class."); |
||
| 10 | } |
||
| 11 | |||
| 12 | public static function forMissingSchema(string $entity): SchemaException |
||
| 13 | { |
||
| 14 | return new self("There is no schema defined for ${entity}."); |
||
| 15 | } |
||
| 16 | |||
| 17 | public static function forSchemaMutation(): SchemaException |
||
| 18 | { |
||
| 19 | return new self('Schema is read only.'); |
||
| 20 | } |
||
| 21 | |||
| 22 | public static function forEmptySchemaDefinition(): SchemaException |
||
| 23 | { |
||
| 24 | return new self('Schema defines no properties, have you forgot to use Schema::property() method.'); |
||
| 25 | } |
||
| 26 | |||
| 27 | public static function forUndefinedSource(): SchemaException |
||
| 28 | { |
||
| 29 | return new self('Schema defines no source, thus entity can be persisted only as embed entity.'); |
||
| 30 | } |
||
| 32 |