From bf6655a534a6775d30cafa67bd801276bda1d98d Mon Sep 17 00:00:00 2001 From: polo Date: Tue, 13 Aug 2024 23:45:21 +0200 Subject: =?UTF-8?q?VERSION=200.2=20doctrine=20ORM=20et=20entit=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/Persistence/Mapping/MappingException.php | 88 ++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 vendor/doctrine/persistence/src/Persistence/Mapping/MappingException.php (limited to 'vendor/doctrine/persistence/src/Persistence/Mapping/MappingException.php') diff --git a/vendor/doctrine/persistence/src/Persistence/Mapping/MappingException.php b/vendor/doctrine/persistence/src/Persistence/Mapping/MappingException.php new file mode 100644 index 0000000..f0bc4eb --- /dev/null +++ b/vendor/doctrine/persistence/src/Persistence/Mapping/MappingException.php @@ -0,0 +1,88 @@ + $namespaces + * + * @return self + */ + public static function classNotFoundInNamespaces( + string $className, + array $namespaces + ) { + return new self(sprintf( + "The class '%s' was not found in the chain configured namespaces %s", + $className, + implode(', ', $namespaces) + )); + } + + /** @param class-string $driverClassName */ + public static function pathRequiredForDriver(string $driverClassName): self + { + return new self(sprintf( + 'Specifying the paths to your entities is required when using %s to retrieve all class names.', + $driverClassName + )); + } + + /** @return self */ + public static function fileMappingDriversRequireConfiguredDirectoryPath( + ?string $path = null + ) { + if ($path !== null) { + $path = '[' . $path . ']'; + } + + return new self(sprintf( + 'File mapping drivers must have a valid directory path, ' . + 'however the given path %s seems to be incorrect!', + (string) $path + )); + } + + /** @return self */ + public static function mappingFileNotFound(string $entityName, string $fileName) + { + return new self(sprintf( + "No mapping file found named '%s' for class '%s'.", + $fileName, + $entityName + )); + } + + /** @return self */ + public static function invalidMappingFile(string $entityName, string $fileName) + { + return new self(sprintf( + "Invalid mapping file '%s' for class '%s'.", + $fileName, + $entityName + )); + } + + /** @return self */ + public static function nonExistingClass(string $className) + { + return new self(sprintf("Class '%s' does not exist", $className)); + } + + /** @param class-string $className */ + public static function classIsAnonymous(string $className): self + { + return new self(sprintf('Class "%s" is anonymous', $className)); + } +} -- cgit v1.2.3