mailpoet
/
vendor-prefixed
/
doctrine
/
persistence
/
src
/
Persistence
/
Mapping
/
MappingException.php
Driver
9 months ago
AbstractClassMetadataFactory.php
8 months ago
ClassMetadata.php
9 months ago
ClassMetadataFactory.php
9 months ago
MappingException.php
9 months ago
ProxyClassNameResolver.php
9 months ago
ReflectionService.php
9 months ago
RuntimeReflectionService.php
9 months ago
StaticReflectionService.php
9 months ago
index.php
3 years ago
MappingException.php
42 lines
| 1 | <?php |
| 2 | declare (strict_types=1); |
| 3 | namespace MailPoetVendor\Doctrine\Persistence\Mapping; |
| 4 | if (!defined('ABSPATH')) exit; |
| 5 | use Exception; |
| 6 | use function implode; |
| 7 | use function sprintf; |
| 8 | class MappingException extends Exception |
| 9 | { |
| 10 | public static function classNotFoundInNamespaces(string $className, array $namespaces) |
| 11 | { |
| 12 | return new self(sprintf("The class '%s' was not found in the chain configured namespaces %s", $className, implode(', ', $namespaces))); |
| 13 | } |
| 14 | public static function pathRequiredForDriver(string $driverClassName) : self |
| 15 | { |
| 16 | return new self(sprintf('Specifying the paths to your entities is required when using %s to retrieve all class names.', $driverClassName)); |
| 17 | } |
| 18 | public static function fileMappingDriversRequireConfiguredDirectoryPath(?string $path = null) |
| 19 | { |
| 20 | if ($path !== null) { |
| 21 | $path = '[' . $path . ']'; |
| 22 | } |
| 23 | return new self(sprintf('File mapping drivers must have a valid directory path, ' . 'however the given path %s seems to be incorrect!', (string) $path)); |
| 24 | } |
| 25 | public static function mappingFileNotFound(string $entityName, string $fileName) |
| 26 | { |
| 27 | return new self(sprintf("No mapping file found named '%s' for class '%s'.", $fileName, $entityName)); |
| 28 | } |
| 29 | public static function invalidMappingFile(string $entityName, string $fileName) |
| 30 | { |
| 31 | return new self(sprintf("Invalid mapping file '%s' for class '%s'.", $fileName, $entityName)); |
| 32 | } |
| 33 | public static function nonExistingClass(string $className) |
| 34 | { |
| 35 | return new self(sprintf("Class '%s' does not exist", $className)); |
| 36 | } |
| 37 | public static function classIsAnonymous(string $className) : self |
| 38 | { |
| 39 | return new self(sprintf('Class "%s" is anonymous', $className)); |
| 40 | } |
| 41 | } |
| 42 |