diff options
| author | polo <ordipolo@gmx.fr> | 2024-08-13 23:45:21 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2024-08-13 23:45:21 +0200 |
| commit | bf6655a534a6775d30cafa67bd801276bda1d98d (patch) | |
| tree | c6381e3f6c81c33eab72508f410b165ba05f7e9c /vendor/doctrine/orm/src/Exception | |
| parent | 94d67a4b51f8e62e7d518cce26a526ae1ec48278 (diff) | |
| download | AppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.tar.gz AppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.tar.bz2 AppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.zip | |
VERSION 0.2 doctrine ORM et entités
Diffstat (limited to 'vendor/doctrine/orm/src/Exception')
17 files changed, 334 insertions, 0 deletions
diff --git a/vendor/doctrine/orm/src/Exception/ConfigurationException.php b/vendor/doctrine/orm/src/Exception/ConfigurationException.php new file mode 100644 index 0000000..45cf83f --- /dev/null +++ b/vendor/doctrine/orm/src/Exception/ConfigurationException.php | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\ORM\Exception; | ||
| 6 | |||
| 7 | interface ConfigurationException extends ORMException | ||
| 8 | { | ||
| 9 | } | ||
diff --git a/vendor/doctrine/orm/src/Exception/EntityIdentityCollisionException.php b/vendor/doctrine/orm/src/Exception/EntityIdentityCollisionException.php new file mode 100644 index 0000000..0af3162 --- /dev/null +++ b/vendor/doctrine/orm/src/Exception/EntityIdentityCollisionException.php | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\ORM\Exception; | ||
| 6 | |||
| 7 | use Exception; | ||
| 8 | |||
| 9 | use function sprintf; | ||
| 10 | |||
| 11 | final class EntityIdentityCollisionException extends Exception implements ORMException | ||
| 12 | { | ||
| 13 | public static function create(object $existingEntity, object $newEntity, string $idHash): self | ||
| 14 | { | ||
| 15 | return new self( | ||
| 16 | sprintf( | ||
| 17 | <<<'EXCEPTION' | ||
| 18 | While adding an entity of class %s with an ID hash of "%s" to the identity map, | ||
| 19 | another object of class %s was already present for the same ID. This exception | ||
| 20 | is a safeguard against an internal inconsistency - IDs should uniquely map to | ||
| 21 | entity object instances. This problem may occur if: | ||
| 22 | |||
| 23 | - you use application-provided IDs and reuse ID values; | ||
| 24 | - database-provided IDs are reassigned after truncating the database without | ||
| 25 | clearing the EntityManager; | ||
| 26 | - you might have been using EntityManager#getReference() to create a reference | ||
| 27 | for a nonexistent ID that was subsequently (by the RDBMS) assigned to another | ||
| 28 | entity. | ||
| 29 | |||
| 30 | Otherwise, it might be an ORM-internal inconsistency, please report it. | ||
| 31 | EXCEPTION | ||
| 32 | , | ||
| 33 | $newEntity::class, | ||
| 34 | $idHash, | ||
| 35 | $existingEntity::class, | ||
| 36 | ), | ||
| 37 | ); | ||
| 38 | } | ||
| 39 | } | ||
diff --git a/vendor/doctrine/orm/src/Exception/EntityManagerClosed.php b/vendor/doctrine/orm/src/Exception/EntityManagerClosed.php new file mode 100644 index 0000000..a769202 --- /dev/null +++ b/vendor/doctrine/orm/src/Exception/EntityManagerClosed.php | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\ORM\Exception; | ||
| 6 | |||
| 7 | use RuntimeException; | ||
| 8 | |||
| 9 | final class EntityManagerClosed extends RuntimeException implements ManagerException | ||
| 10 | { | ||
| 11 | public static function create(): self | ||
| 12 | { | ||
| 13 | return new self('The EntityManager is closed.'); | ||
| 14 | } | ||
| 15 | } | ||
diff --git a/vendor/doctrine/orm/src/Exception/EntityMissingAssignedId.php b/vendor/doctrine/orm/src/Exception/EntityMissingAssignedId.php new file mode 100644 index 0000000..d566436 --- /dev/null +++ b/vendor/doctrine/orm/src/Exception/EntityMissingAssignedId.php | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\ORM\Exception; | ||
| 6 | |||
| 7 | use LogicException; | ||
| 8 | |||
| 9 | use function get_debug_type; | ||
| 10 | |||
| 11 | final class EntityMissingAssignedId extends LogicException implements ORMException | ||
| 12 | { | ||
| 13 | public static function forField(object $entity, string $field): self | ||
| 14 | { | ||
| 15 | return new self('Entity of type ' . get_debug_type($entity) . " is missing an assigned ID for field '" . $field . "'. " . | ||
| 16 | 'The identifier generation strategy for this entity requires the ID field to be populated before ' . | ||
| 17 | 'EntityManager#persist() is called. If you want automatically generated identifiers instead ' . | ||
| 18 | 'you need to adjust the metadata mapping accordingly.'); | ||
| 19 | } | ||
| 20 | } | ||
diff --git a/vendor/doctrine/orm/src/Exception/InvalidEntityRepository.php b/vendor/doctrine/orm/src/Exception/InvalidEntityRepository.php new file mode 100644 index 0000000..c28143d --- /dev/null +++ b/vendor/doctrine/orm/src/Exception/InvalidEntityRepository.php | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\ORM\Exception; | ||
| 6 | |||
| 7 | use Doctrine\ORM\EntityRepository; | ||
| 8 | use LogicException; | ||
| 9 | |||
| 10 | final class InvalidEntityRepository extends LogicException implements ConfigurationException | ||
| 11 | { | ||
| 12 | public static function fromClassName(string $className): self | ||
| 13 | { | ||
| 14 | return new self( | ||
| 15 | "Invalid repository class '" . $className . "'. It must be a " . EntityRepository::class . '.', | ||
| 16 | ); | ||
| 17 | } | ||
| 18 | } | ||
diff --git a/vendor/doctrine/orm/src/Exception/InvalidHydrationMode.php b/vendor/doctrine/orm/src/Exception/InvalidHydrationMode.php new file mode 100644 index 0000000..d07d84c --- /dev/null +++ b/vendor/doctrine/orm/src/Exception/InvalidHydrationMode.php | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\ORM\Exception; | ||
| 6 | |||
| 7 | use LogicException; | ||
| 8 | |||
| 9 | use function sprintf; | ||
| 10 | |||
| 11 | final class InvalidHydrationMode extends LogicException implements ManagerException | ||
| 12 | { | ||
| 13 | public static function fromMode(string $mode): self | ||
| 14 | { | ||
| 15 | return new self(sprintf('"%s" is an invalid hydration mode.', $mode)); | ||
| 16 | } | ||
| 17 | } | ||
diff --git a/vendor/doctrine/orm/src/Exception/ManagerException.php b/vendor/doctrine/orm/src/Exception/ManagerException.php new file mode 100644 index 0000000..f9bc7ff --- /dev/null +++ b/vendor/doctrine/orm/src/Exception/ManagerException.php | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\ORM\Exception; | ||
| 6 | |||
| 7 | use Throwable; | ||
| 8 | |||
| 9 | interface ManagerException extends Throwable | ||
| 10 | { | ||
| 11 | } | ||
diff --git a/vendor/doctrine/orm/src/Exception/MissingIdentifierField.php b/vendor/doctrine/orm/src/Exception/MissingIdentifierField.php new file mode 100644 index 0000000..2c02db4 --- /dev/null +++ b/vendor/doctrine/orm/src/Exception/MissingIdentifierField.php | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\ORM\Exception; | ||
| 6 | |||
| 7 | use LogicException; | ||
| 8 | |||
| 9 | use function sprintf; | ||
| 10 | |||
| 11 | final class MissingIdentifierField extends LogicException implements ManagerException | ||
| 12 | { | ||
| 13 | public static function fromFieldAndClass(string $fieldName, string $className): self | ||
| 14 | { | ||
| 15 | return new self(sprintf( | ||
| 16 | 'The identifier %s is missing for a query of %s', | ||
| 17 | $fieldName, | ||
| 18 | $className, | ||
| 19 | )); | ||
| 20 | } | ||
| 21 | } | ||
diff --git a/vendor/doctrine/orm/src/Exception/MissingMappingDriverImplementation.php b/vendor/doctrine/orm/src/Exception/MissingMappingDriverImplementation.php new file mode 100644 index 0000000..ce5104b --- /dev/null +++ b/vendor/doctrine/orm/src/Exception/MissingMappingDriverImplementation.php | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\ORM\Exception; | ||
| 6 | |||
| 7 | use LogicException; | ||
| 8 | |||
| 9 | final class MissingMappingDriverImplementation extends LogicException implements ManagerException | ||
| 10 | { | ||
| 11 | public static function create(): self | ||
| 12 | { | ||
| 13 | return new self( | ||
| 14 | "It's a requirement to specify a Metadata Driver and pass it " . | ||
| 15 | 'to Doctrine\\ORM\\Configuration::setMetadataDriverImpl().', | ||
| 16 | ); | ||
| 17 | } | ||
| 18 | } | ||
diff --git a/vendor/doctrine/orm/src/Exception/MultipleSelectorsFoundException.php b/vendor/doctrine/orm/src/Exception/MultipleSelectorsFoundException.php new file mode 100644 index 0000000..8084d66 --- /dev/null +++ b/vendor/doctrine/orm/src/Exception/MultipleSelectorsFoundException.php | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\ORM\Exception; | ||
| 6 | |||
| 7 | use LogicException; | ||
| 8 | |||
| 9 | use function implode; | ||
| 10 | use function sprintf; | ||
| 11 | |||
| 12 | final class MultipleSelectorsFoundException extends LogicException implements ORMException | ||
| 13 | { | ||
| 14 | public const MULTIPLE_SELECTORS_FOUND_EXCEPTION = 'Multiple selectors found: %s. Please select only one.'; | ||
| 15 | |||
| 16 | /** @param string[] $selectors */ | ||
| 17 | public static function create(array $selectors): self | ||
| 18 | { | ||
| 19 | return new self( | ||
| 20 | sprintf( | ||
| 21 | self::MULTIPLE_SELECTORS_FOUND_EXCEPTION, | ||
| 22 | implode(', ', $selectors), | ||
| 23 | ), | ||
| 24 | ); | ||
| 25 | } | ||
| 26 | } | ||
diff --git a/vendor/doctrine/orm/src/Exception/NotSupported.php b/vendor/doctrine/orm/src/Exception/NotSupported.php new file mode 100644 index 0000000..9192f87 --- /dev/null +++ b/vendor/doctrine/orm/src/Exception/NotSupported.php | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\ORM\Exception; | ||
| 6 | |||
| 7 | use LogicException; | ||
| 8 | |||
| 9 | use function sprintf; | ||
| 10 | |||
| 11 | /** @deprecated */ | ||
| 12 | final class NotSupported extends LogicException implements ORMException | ||
| 13 | { | ||
| 14 | public static function create(): self | ||
| 15 | { | ||
| 16 | return new self('This behaviour is (currently) not supported by Doctrine 2'); | ||
| 17 | } | ||
| 18 | |||
| 19 | public static function createForDbal3(string $context): self | ||
| 20 | { | ||
| 21 | return new self(sprintf( | ||
| 22 | <<<'EXCEPTION' | ||
| 23 | Context: %s | ||
| 24 | Problem: Feature was deprecated in doctrine/dbal 2.x and is not supported by installed doctrine/dbal:3.x | ||
| 25 | Solution: See the doctrine/deprecations logs for new alternative approaches. | ||
| 26 | EXCEPTION | ||
| 27 | , | ||
| 28 | $context, | ||
| 29 | )); | ||
| 30 | } | ||
| 31 | |||
| 32 | public static function createForPersistence3(string $context): self | ||
| 33 | { | ||
| 34 | return new self(sprintf( | ||
| 35 | <<<'EXCEPTION' | ||
| 36 | Context: %s | ||
| 37 | Problem: Feature was deprecated in doctrine/persistence 2.x and is not supported by installed doctrine/persistence:3.x | ||
| 38 | Solution: See the doctrine/deprecations logs for new alternative approaches. | ||
| 39 | EXCEPTION | ||
| 40 | , | ||
| 41 | $context, | ||
| 42 | )); | ||
| 43 | } | ||
| 44 | } | ||
diff --git a/vendor/doctrine/orm/src/Exception/ORMException.php b/vendor/doctrine/orm/src/Exception/ORMException.php new file mode 100644 index 0000000..a59b483 --- /dev/null +++ b/vendor/doctrine/orm/src/Exception/ORMException.php | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\ORM\Exception; | ||
| 6 | |||
| 7 | use Throwable; | ||
| 8 | |||
| 9 | interface ORMException extends Throwable | ||
| 10 | { | ||
| 11 | } | ||
diff --git a/vendor/doctrine/orm/src/Exception/PersisterException.php b/vendor/doctrine/orm/src/Exception/PersisterException.php new file mode 100644 index 0000000..2563a46 --- /dev/null +++ b/vendor/doctrine/orm/src/Exception/PersisterException.php | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\ORM\Exception; | ||
| 6 | |||
| 7 | use Doctrine\ORM\Persisters\PersisterException as BasePersisterException; | ||
| 8 | |||
| 9 | class PersisterException extends BasePersisterException | ||
| 10 | { | ||
| 11 | } | ||
diff --git a/vendor/doctrine/orm/src/Exception/RepositoryException.php b/vendor/doctrine/orm/src/Exception/RepositoryException.php new file mode 100644 index 0000000..3b2d51b --- /dev/null +++ b/vendor/doctrine/orm/src/Exception/RepositoryException.php | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\ORM\Exception; | ||
| 6 | |||
| 7 | /** | ||
| 8 | * This interface should be implemented by all exceptions in the Repository | ||
| 9 | * namespace. | ||
| 10 | */ | ||
| 11 | interface RepositoryException extends ORMException | ||
| 12 | { | ||
| 13 | } | ||
diff --git a/vendor/doctrine/orm/src/Exception/SchemaToolException.php b/vendor/doctrine/orm/src/Exception/SchemaToolException.php new file mode 100644 index 0000000..e4477d0 --- /dev/null +++ b/vendor/doctrine/orm/src/Exception/SchemaToolException.php | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\ORM\Exception; | ||
| 6 | |||
| 7 | use Throwable; | ||
| 8 | |||
| 9 | interface SchemaToolException extends Throwable | ||
| 10 | { | ||
| 11 | } | ||
diff --git a/vendor/doctrine/orm/src/Exception/UnexpectedAssociationValue.php b/vendor/doctrine/orm/src/Exception/UnexpectedAssociationValue.php new file mode 100644 index 0000000..cf3ca18 --- /dev/null +++ b/vendor/doctrine/orm/src/Exception/UnexpectedAssociationValue.php | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\ORM\Exception; | ||
| 6 | |||
| 7 | use Doctrine\ORM\Cache\Exception\CacheException; | ||
| 8 | |||
| 9 | use function sprintf; | ||
| 10 | |||
| 11 | final class UnexpectedAssociationValue extends CacheException | ||
| 12 | { | ||
| 13 | public static function create( | ||
| 14 | string $class, | ||
| 15 | string $association, | ||
| 16 | string $given, | ||
| 17 | string $expected, | ||
| 18 | ): self { | ||
| 19 | return new self(sprintf( | ||
| 20 | 'Found entity of type %s on association %s#%s, but expecting %s', | ||
| 21 | $given, | ||
| 22 | $class, | ||
| 23 | $association, | ||
| 24 | $expected, | ||
| 25 | )); | ||
| 26 | } | ||
| 27 | } | ||
diff --git a/vendor/doctrine/orm/src/Exception/UnrecognizedIdentifierFields.php b/vendor/doctrine/orm/src/Exception/UnrecognizedIdentifierFields.php new file mode 100644 index 0000000..645bdae --- /dev/null +++ b/vendor/doctrine/orm/src/Exception/UnrecognizedIdentifierFields.php | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\ORM\Exception; | ||
| 6 | |||
| 7 | use LogicException; | ||
| 8 | |||
| 9 | use function implode; | ||
| 10 | use function sprintf; | ||
| 11 | |||
| 12 | final class UnrecognizedIdentifierFields extends LogicException implements ManagerException | ||
| 13 | { | ||
| 14 | /** @param string[] $fieldNames */ | ||
| 15 | public static function fromClassAndFieldNames(string $className, array $fieldNames): self | ||
| 16 | { | ||
| 17 | return new self(sprintf( | ||
| 18 | 'Unrecognized identifier fields: "%s" are not present on class "%s".', | ||
| 19 | implode("', '", $fieldNames), | ||
| 20 | $className, | ||
| 21 | )); | ||
| 22 | } | ||
| 23 | } | ||
