diff --git a/.phpstan.neon b/.phpstan.neon index b9dfa31c..0680c757 100644 --- a/.phpstan.neon +++ b/.phpstan.neon @@ -17,6 +17,9 @@ parameters: treatPhpDocTypesAsCertain: false ignoreErrors: - '#Call to static method Tester\\Assert::type\(\).+will always evaluate to true\.#' + - + message: '~.*~' + path: "src/compatibility.php" services: - diff --git a/composer.json b/composer.json index 1c11d8b0..6194f062 100644 --- a/composer.json +++ b/composer.json @@ -49,9 +49,7 @@ "psr-4": { "Nextras\\Orm\\": "src/" }, - "classmap": [ - "src/exceptions.php" - ] + "files": ["src/compatibility.php"] }, "autoload-dev": { "classmap": [ diff --git a/doc/model.texy b/doc/model.texy index 4d1562ee..d6cf81c3 100644 --- a/doc/model.texy +++ b/doc/model.texy @@ -60,7 +60,7 @@ $model->refreshAll(); // $book is updated with the latest data from database \-- -Also, some entities may be changed but not persisted. Calling `refreshAll()` in such case will throw an `Nextras\Orm\InvalidStateException` exception. You may allow data override by passing `true` argument to the method. +Also, some entities may be changed but not persisted. Calling `refreshAll()` in such case will throw an `Nextras\Orm\Exception\InvalidStateException` exception. You may allow data override by passing `true` argument to the method. /--php $book = $model->books->getById(1); diff --git a/src/Bridges/NetteDI/DIRepositoryFinder.php b/src/Bridges/NetteDI/DIRepositoryFinder.php index b18adea0..3ca261f3 100644 --- a/src/Bridges/NetteDI/DIRepositoryFinder.php +++ b/src/Bridges/NetteDI/DIRepositoryFinder.php @@ -6,7 +6,7 @@ use Nette\DI\ContainerBuilder; use Nette\DI\Definitions\FactoryDefinition; use Nette\DI\Definitions\ServiceDefinition; -use Nextras\Orm\InvalidStateException; +use Nextras\Orm\Exception\InvalidStateException; use Nextras\Orm\Repository\IRepository; diff --git a/src/Bridges/NetteDI/OrmExtension.php b/src/Bridges/NetteDI/OrmExtension.php index ed2dd44b..86b24be2 100644 --- a/src/Bridges/NetteDI/OrmExtension.php +++ b/src/Bridges/NetteDI/OrmExtension.php @@ -9,7 +9,7 @@ use Nextras\Dbal\IConnection; use Nextras\Orm\Entity\Reflection\IMetadataParserFactory; use Nextras\Orm\Entity\Reflection\MetadataParser; -use Nextras\Orm\InvalidStateException; +use Nextras\Orm\Exception\InvalidStateException; use Nextras\Orm\Mapper\Dbal\DbalMapperCoordinator; use Nextras\Orm\Model\MetadataStorage; use Nextras\Orm\Model\Model; diff --git a/src/Bridges/NetteDI/PhpDocRepositoryFinder.php b/src/Bridges/NetteDI/PhpDocRepositoryFinder.php index 4b3ff9f2..a3f18524 100644 --- a/src/Bridges/NetteDI/PhpDocRepositoryFinder.php +++ b/src/Bridges/NetteDI/PhpDocRepositoryFinder.php @@ -5,10 +5,10 @@ use Nette\DI\ContainerBuilder; use Nette\Utils\Reflection; -use Nextras\Orm\InvalidStateException; +use Nextras\Orm\Exception\InvalidStateException; +use Nextras\Orm\Exception\RuntimeException; use Nextras\Orm\Model\Model; use Nextras\Orm\Repository\IRepository; -use Nextras\Orm\RuntimeException; use ReflectionClass; diff --git a/src/Collection/ArrayCollection.php b/src/Collection/ArrayCollection.php index fff336fd..b1d30b52 100644 --- a/src/Collection/ArrayCollection.php +++ b/src/Collection/ArrayCollection.php @@ -10,10 +10,10 @@ use Nextras\Orm\Collection\Helpers\ArrayCollectionHelper; use Nextras\Orm\Collection\Helpers\FetchPairsHelper; use Nextras\Orm\Entity\IEntity; -use Nextras\Orm\InvalidArgumentException; +use Nextras\Orm\Exception\InvalidArgumentException; +use Nextras\Orm\Exception\MemberAccessException; +use Nextras\Orm\Exception\NoResultException; use Nextras\Orm\Mapper\IRelationshipMapper; -use Nextras\Orm\MemberAccessException; -use Nextras\Orm\NoResultException; use Nextras\Orm\Repository\IRepository; use function array_values; diff --git a/src/Collection/DbalCollection.php b/src/Collection/DbalCollection.php index 10d9a2bb..02c58c45 100644 --- a/src/Collection/DbalCollection.php +++ b/src/Collection/DbalCollection.php @@ -9,10 +9,10 @@ use Nextras\Orm\Collection\Helpers\DbalQueryBuilderHelper; use Nextras\Orm\Collection\Helpers\FetchPairsHelper; use Nextras\Orm\Entity\IEntity; +use Nextras\Orm\Exception\MemberAccessException; +use Nextras\Orm\Exception\NoResultException; use Nextras\Orm\Mapper\Dbal\DbalMapper; use Nextras\Orm\Mapper\IRelationshipMapper; -use Nextras\Orm\MemberAccessException; -use Nextras\Orm\NoResultException; use function count; use function is_array; diff --git a/src/Collection/EmptyCollection.php b/src/Collection/EmptyCollection.php index 5b2f48d6..c3da892f 100644 --- a/src/Collection/EmptyCollection.php +++ b/src/Collection/EmptyCollection.php @@ -6,8 +6,8 @@ use EmptyIterator; use Iterator; use Nextras\Orm\Entity\IEntity; +use Nextras\Orm\Exception\NoResultException; use Nextras\Orm\Mapper\IRelationshipMapper; -use Nextras\Orm\NoResultException; class EmptyCollection implements ICollection diff --git a/src/Collection/EntityIterator.php b/src/Collection/EntityIterator.php index 9a2760ff..06a5e40a 100644 --- a/src/Collection/EntityIterator.php +++ b/src/Collection/EntityIterator.php @@ -8,7 +8,7 @@ use Nette\Utils\Arrays; use Nextras\Orm\Entity\IEntity; use Nextras\Orm\Entity\IEntityHasPreloadContainer; -use Nextras\Orm\InvalidStateException; +use Nextras\Orm\Exception\InvalidStateException; /** diff --git a/src/Collection/Functions/BaseAggregateFunction.php b/src/Collection/Functions/BaseAggregateFunction.php index fadc3010..2712503c 100644 --- a/src/Collection/Functions/BaseAggregateFunction.php +++ b/src/Collection/Functions/BaseAggregateFunction.php @@ -8,7 +8,7 @@ use Nextras\Orm\Collection\Helpers\DbalExpressionResult; use Nextras\Orm\Collection\Helpers\DbalQueryBuilderHelper; use Nextras\Orm\Entity\IEntity; -use Nextras\Orm\InvalidArgumentException; +use Nextras\Orm\Exception\InvalidArgumentException; use function assert; use function count; use function is_array; diff --git a/src/Collection/Functions/CompareLikeFunction.php b/src/Collection/Functions/CompareLikeFunction.php index 4625c6cb..cb05f99b 100644 --- a/src/Collection/Functions/CompareLikeFunction.php +++ b/src/Collection/Functions/CompareLikeFunction.php @@ -10,7 +10,7 @@ use Nextras\Orm\Collection\Helpers\DbalExpressionResult; use Nextras\Orm\Collection\Helpers\DbalQueryBuilderHelper; use Nextras\Orm\Entity\IEntity; -use Nextras\Orm\InvalidStateException; +use Nextras\Orm\Exception\InvalidStateException; use function preg_quote; use function str_replace; diff --git a/src/Collection/HasManyCollection.php b/src/Collection/HasManyCollection.php index 6f7fdb49..0b54636a 100644 --- a/src/Collection/HasManyCollection.php +++ b/src/Collection/HasManyCollection.php @@ -6,9 +6,9 @@ use Iterator; use Nextras\Orm\Collection\Helpers\FetchPairsHelper; use Nextras\Orm\Entity\IEntity; +use Nextras\Orm\Exception\MemberAccessException; +use Nextras\Orm\Exception\NoResultException; use Nextras\Orm\Mapper\IRelationshipMapper; -use Nextras\Orm\MemberAccessException; -use Nextras\Orm\NoResultException; use Nextras\Orm\Repository\IRepository; use function array_map; use function count; diff --git a/src/Collection/Helpers/ArrayCollectionHelper.php b/src/Collection/Helpers/ArrayCollectionHelper.php index 4f9cac5e..b04cf956 100644 --- a/src/Collection/Helpers/ArrayCollectionHelper.php +++ b/src/Collection/Helpers/ArrayCollectionHelper.php @@ -14,9 +14,8 @@ use Nextras\Orm\Entity\Reflection\EntityMetadata; use Nextras\Orm\Entity\Reflection\PropertyMetadata; use Nextras\Orm\Entity\Reflection\PropertyRelationshipMetadata; -use Nextras\Orm\InvalidArgumentException; -use Nextras\Orm\InvalidStateException; -use Nextras\Orm\Mapper\IMapper; +use Nextras\Orm\Exception\InvalidArgumentException; +use Nextras\Orm\Exception\InvalidStateException; use Nextras\Orm\Repository\IRepository; use function array_map; use function array_shift; diff --git a/src/Collection/Helpers/ConditionParser.php b/src/Collection/Helpers/ConditionParser.php index 075654d5..d8c22374 100644 --- a/src/Collection/Helpers/ConditionParser.php +++ b/src/Collection/Helpers/ConditionParser.php @@ -11,8 +11,8 @@ use Nextras\Orm\Collection\Functions\CompareSmallerThanEqualsFunction; use Nextras\Orm\Collection\Functions\CompareSmallerThanFunction; use Nextras\Orm\Entity\IEntity; -use Nextras\Orm\InvalidArgumentException; -use Nextras\Orm\InvalidStateException; +use Nextras\Orm\Exception\InvalidArgumentException; +use Nextras\Orm\Exception\InvalidStateException; use function array_shift; use function explode; use function is_subclass_of; diff --git a/src/Collection/Helpers/DbalQueryBuilderHelper.php b/src/Collection/Helpers/DbalQueryBuilderHelper.php index 9c03b8a5..041d03d5 100644 --- a/src/Collection/Helpers/DbalQueryBuilderHelper.php +++ b/src/Collection/Helpers/DbalQueryBuilderHelper.php @@ -12,11 +12,11 @@ use Nextras\Orm\Entity\Reflection\EntityMetadata; use Nextras\Orm\Entity\Reflection\PropertyMetadata; use Nextras\Orm\Entity\Reflection\PropertyRelationshipMetadata as Relationship; -use Nextras\Orm\InvalidArgumentException; +use Nextras\Orm\Exception\InvalidArgumentException; +use Nextras\Orm\Exception\NotSupportedException; use Nextras\Orm\Mapper\Dbal\Conventions\IConventions; use Nextras\Orm\Mapper\Dbal\DbalMapper; use Nextras\Orm\Model\IModel; -use Nextras\Orm\NotSupportedException; use Nextras\Orm\Repository\IRepository; use function array_map; use function array_merge; diff --git a/src/Collection/Helpers/FetchPairsHelper.php b/src/Collection/Helpers/FetchPairsHelper.php index 0af502fc..e0c5d5ee 100644 --- a/src/Collection/Helpers/FetchPairsHelper.php +++ b/src/Collection/Helpers/FetchPairsHelper.php @@ -6,8 +6,8 @@ use Nextras\Dbal\Utils\DateTimeImmutable; use Nextras\Orm\Entity\Embeddable\IEmbeddable; use Nextras\Orm\Entity\IEntity; -use Nextras\Orm\InvalidArgumentException; -use Nextras\Orm\InvalidStateException; +use Nextras\Orm\Exception\InvalidArgumentException; +use Nextras\Orm\Exception\InvalidStateException; use Traversable; use function array_shift; use function assert; diff --git a/src/Collection/ICollection.php b/src/Collection/ICollection.php index 9409a9bb..6f56165b 100644 --- a/src/Collection/ICollection.php +++ b/src/Collection/ICollection.php @@ -9,8 +9,8 @@ use Nextras\Orm\Collection\Functions\ConjunctionOperatorFunction; use Nextras\Orm\Collection\Functions\DisjunctionOperatorFunction; use Nextras\Orm\Entity\IEntity; +use Nextras\Orm\Exception\NoResultException; use Nextras\Orm\Mapper\IRelationshipMapper; -use Nextras\Orm\NoResultException; /** diff --git a/src/Collection/MultiEntityIterator.php b/src/Collection/MultiEntityIterator.php index 93d181ae..794e76fa 100644 --- a/src/Collection/MultiEntityIterator.php +++ b/src/Collection/MultiEntityIterator.php @@ -8,7 +8,7 @@ use Nette\Utils\Arrays; use Nextras\Orm\Entity\IEntity; use Nextras\Orm\Entity\IEntityHasPreloadContainer; -use Nextras\Orm\InvalidStateException; +use Nextras\Orm\Exception\InvalidStateException; /** diff --git a/src/Entity/AbstractEntity.php b/src/Entity/AbstractEntity.php index 4cd3da66..4bd14881 100644 --- a/src/Entity/AbstractEntity.php +++ b/src/Entity/AbstractEntity.php @@ -6,10 +6,10 @@ use Nextras\Orm\Entity\Embeddable\EmbeddableContainer; use Nextras\Orm\Entity\Reflection\EntityMetadata; use Nextras\Orm\Entity\Reflection\PropertyMetadata; -use Nextras\Orm\InvalidArgumentException; -use Nextras\Orm\InvalidStateException; -use Nextras\Orm\LogicException; -use Nextras\Orm\NullValueException; +use Nextras\Orm\Exception\InvalidArgumentException; +use Nextras\Orm\Exception\InvalidStateException; +use Nextras\Orm\Exception\LogicException; +use Nextras\Orm\Exception\NullValueException; use Nextras\Orm\Relationships\IRelationshipCollection; use Nextras\Orm\Relationships\IRelationshipContainer; use Nextras\Orm\Repository\IRepository; diff --git a/src/Entity/Embeddable/Embeddable.php b/src/Entity/Embeddable/Embeddable.php index 1bee5b8f..83190375 100644 --- a/src/Entity/Embeddable/Embeddable.php +++ b/src/Entity/Embeddable/Embeddable.php @@ -9,10 +9,10 @@ use Nextras\Orm\Entity\IProperty; use Nextras\Orm\Entity\IPropertyContainer; use Nextras\Orm\Entity\Reflection\PropertyMetadata; -use Nextras\Orm\InvalidArgumentException; -use Nextras\Orm\InvalidStateException; -use Nextras\Orm\LogicException; -use Nextras\Orm\NotSupportedException; +use Nextras\Orm\Exception\InvalidArgumentException; +use Nextras\Orm\Exception\InvalidStateException; +use Nextras\Orm\Exception\LogicException; +use Nextras\Orm\Exception\NotSupportedException; use function assert; use function call_user_func; use function count; diff --git a/src/Entity/Embeddable/EmbeddableContainer.php b/src/Entity/Embeddable/EmbeddableContainer.php index d334f132..4fff76d2 100644 --- a/src/Entity/Embeddable/EmbeddableContainer.php +++ b/src/Entity/Embeddable/EmbeddableContainer.php @@ -8,9 +8,9 @@ use Nextras\Orm\Entity\IEntityAwareProperty; use Nextras\Orm\Entity\IPropertyContainer; use Nextras\Orm\Entity\Reflection\PropertyMetadata; -use Nextras\Orm\InvalidArgumentException; +use Nextras\Orm\Exception\InvalidArgumentException; +use Nextras\Orm\Exception\NullValueException; use Nextras\Orm\Model\MetadataStorage; -use Nextras\Orm\NullValueException; use ReflectionClass; use function array_filter; use function assert; diff --git a/src/Entity/Entity.php b/src/Entity/Entity.php index 5b5a84f4..53d85f48 100644 --- a/src/Entity/Entity.php +++ b/src/Entity/Entity.php @@ -4,7 +4,7 @@ use Nextras\Orm\Collection\IEntityPreloadContainer; -use Nextras\Orm\NotSupportedException; +use Nextras\Orm\Exception\NotSupportedException; class Entity extends AbstractEntity implements IEntityHasPreloadContainer diff --git a/src/Entity/ImmutableDataTrait.php b/src/Entity/ImmutableDataTrait.php index 4e013016..0a27d3f3 100644 --- a/src/Entity/ImmutableDataTrait.php +++ b/src/Entity/ImmutableDataTrait.php @@ -5,8 +5,8 @@ use Nextras\Orm\Entity\Reflection\EntityMetadata; use Nextras\Orm\Entity\Reflection\PropertyMetadata; -use Nextras\Orm\InvalidArgumentException; -use Nextras\Orm\InvalidStateException; +use Nextras\Orm\Exception\InvalidArgumentException; +use Nextras\Orm\Exception\InvalidStateException; use Nextras\Orm\Model\MetadataStorage; diff --git a/src/Entity/Reflection/EntityMetadata.php b/src/Entity/Reflection/EntityMetadata.php index 78b90c29..ed3e4983 100644 --- a/src/Entity/Reflection/EntityMetadata.php +++ b/src/Entity/Reflection/EntityMetadata.php @@ -5,7 +5,7 @@ use Nette\SmartObject; use Nextras\Orm\Entity\Helpers\Typos; -use Nextras\Orm\InvalidArgumentException; +use Nextras\Orm\Exception\InvalidArgumentException; /** diff --git a/src/Entity/Reflection/InvalidModifierDefinitionException.php b/src/Entity/Reflection/InvalidModifierDefinitionException.php new file mode 100644 index 00000000..be6c703d --- /dev/null +++ b/src/Entity/Reflection/InvalidModifierDefinitionException.php @@ -0,0 +1,11 @@ +name} is not nullable."); + } +} diff --git a/src/Exception/RuntimeException.php b/src/Exception/RuntimeException.php new file mode 100644 index 00000000..fbe9bbad --- /dev/null +++ b/src/Exception/RuntimeException.php @@ -0,0 +1,8 @@ +name} is not nullable."); + } + } +} elseif (!class_exists(NullValueException::class)) { + class_alias(\Nextras\Orm\Exception\NullValueException::class, NullValueException::class); +} + +if (false) { + /** @deprecated use Nextras\Orm\Exception\RuntimeException */ + class RuntimeException extends \RuntimeException + { + } +} elseif (!class_exists(RuntimeException::class)) { + class_alias(\Nextras\Orm\Exception\RuntimeException::class, RuntimeException::class); +} + +if (false) { + /** @deprecated use Nextras\Orm\Exception\InvalidStateException */ + class InvalidStateException extends RuntimeException + { + } +} elseif (!class_exists(InvalidStateException::class)) { + class_alias(\Nextras\Orm\Exception\InvalidStateException::class, InvalidStateException::class); +} + +if (false) { + /** @deprecated use Nextras\Orm\Exception\IOException */ + class IOException extends RuntimeException + { + } +} elseif (!class_exists(IOException::class)) { + class_alias(\Nextras\Orm\Exception\IOException::class, IOException::class); +} + +if (false) { + /** @deprecated use Nextras\Orm\Exception\LogicException */ + class LogicException extends \LogicException + { + } +} elseif (!class_exists(LogicException::class)) { + class_alias(\Nextras\Orm\Exception\LogicException::class, LogicException::class); +} + +if (false) { + /** @deprecated use Nextras\Orm\Exception\MemberAccessException */ + class MemberAccessException extends LogicException + { + } +} elseif (!class_exists(MemberAccessException::class)) { + class_alias(\Nextras\Orm\Exception\MemberAccessException::class, MemberAccessException::class); +} + +if (false) { + /** @deprecated use Nextras\Orm\Exception\NotImplementedException */ + class NotImplementedException extends LogicException + { + } +} elseif (!class_exists(NotImplementedException::class)) { + class_alias(\Nextras\Orm\Exception\NotImplementedException::class, NotImplementedException::class); +} + +if (false) { + /** @deprecated use Nextras\Orm\Exception\NotSupportedException */ + class NotSupportedException extends LogicException + { + } +} elseif (!class_exists(NotSupportedException::class)) { + class_alias(\Nextras\Orm\Exception\NotSupportedException::class, NotSupportedException::class); +} diff --git a/src/exceptions.php b/src/exceptions.php deleted file mode 100644 index f9c1462f..00000000 --- a/src/exceptions.php +++ /dev/null @@ -1,62 +0,0 @@ -name} is not nullable."); - } -} - - -class RuntimeException extends \RuntimeException -{ -} - - -class InvalidStateException extends RuntimeException -{ -} - - -class IOException extends RuntimeException -{ -} - - -class LogicException extends \LogicException -{ -} - - -class MemberAccessException extends LogicException -{ -} - - -class NotImplementedException extends LogicException -{ -} - - -class NotSupportedException extends LogicException -{ -} diff --git a/tests/cases/integration/Collection/collection.embeddables.phpt b/tests/cases/integration/Collection/collection.embeddables.phpt index dbc98e1c..4aac2ada 100644 --- a/tests/cases/integration/Collection/collection.embeddables.phpt +++ b/tests/cases/integration/Collection/collection.embeddables.phpt @@ -8,7 +8,7 @@ namespace NextrasTests\Orm\Integration\Collection; -use Nextras\Orm\InvalidArgumentException; +use Nextras\Orm\Exception\InvalidArgumentException; use NextrasTests\Orm\Currency; use NextrasTests\Orm\DataTestCase; use NextrasTests\Orm\Money; diff --git a/tests/cases/integration/Collection/collection.phpt b/tests/cases/integration/Collection/collection.phpt index 84c449c0..ddec9b6a 100644 --- a/tests/cases/integration/Collection/collection.phpt +++ b/tests/cases/integration/Collection/collection.phpt @@ -9,7 +9,7 @@ namespace NextrasTests\Orm\Integration\Collection; use Nextras\Orm\Collection\ICollection; -use Nextras\Orm\NoResultException; +use Nextras\Orm\Exception\NoResultException; use NextrasTests\Orm\Book; use NextrasTests\Orm\DataTestCase; use NextrasTests\Orm\Ean; diff --git a/tests/cases/integration/Entity/entity.compositePK.phpt b/tests/cases/integration/Entity/entity.compositePK.phpt index bbf928d4..a640005a 100644 --- a/tests/cases/integration/Entity/entity.compositePK.phpt +++ b/tests/cases/integration/Entity/entity.compositePK.phpt @@ -9,7 +9,7 @@ namespace NextrasTests\Orm\Integration\Entity; use DateTimeImmutable; -use Nextras\Orm\InvalidArgumentException; +use Nextras\Orm\Exception\InvalidArgumentException; use NextrasTests\Orm\DataTestCase; use NextrasTests\Orm\Helper; use NextrasTests\Orm\User; diff --git a/tests/cases/integration/Entity/entity.embeddable.phpt b/tests/cases/integration/Entity/entity.embeddable.phpt index 9608cf70..c68a4ab3 100644 --- a/tests/cases/integration/Entity/entity.embeddable.phpt +++ b/tests/cases/integration/Entity/entity.embeddable.phpt @@ -8,8 +8,8 @@ namespace NextrasTests\Orm\Entity; -use Nextras\Orm\InvalidArgumentException; -use Nextras\Orm\NullValueException; +use Nextras\Orm\Exception\InvalidArgumentException; +use Nextras\Orm\Exception\NullValueException; use NextrasTests\Orm\Book; use NextrasTests\Orm\Currency; use NextrasTests\Orm\DataTestCase; diff --git a/tests/cases/integration/Entity/entity.nullValidation.phpt b/tests/cases/integration/Entity/entity.nullValidation.phpt index df5185fa..c0332221 100644 --- a/tests/cases/integration/Entity/entity.nullValidation.phpt +++ b/tests/cases/integration/Entity/entity.nullValidation.phpt @@ -7,9 +7,9 @@ namespace NextrasTests\Orm\Integration\Entity; -use Nextras\Orm\InvalidArgumentException; -use Nextras\Orm\InvalidStateException; -use Nextras\Orm\NullValueException; +use Nextras\Orm\Exception\InvalidArgumentException; +use Nextras\Orm\Exception\InvalidStateException; +use Nextras\Orm\Exception\NullValueException; use NextrasTests\Orm\Book; use NextrasTests\Orm\TestCase; use Tester\Assert; diff --git a/tests/cases/integration/Mapper/DbalPersistAutoupdateMapperTest.phpt b/tests/cases/integration/Mapper/DbalPersistAutoupdateMapperTest.phpt index 6fe3ffd0..65c0a01c 100644 --- a/tests/cases/integration/Mapper/DbalPersistAutoupdateMapperTest.phpt +++ b/tests/cases/integration/Mapper/DbalPersistAutoupdateMapperTest.phpt @@ -12,7 +12,7 @@ use DateTime; use DateTimeImmutable; use Nextras\Dbal\Connection; use Nextras\Dbal\IConnection; -use Nextras\Orm\InvalidStateException; +use Nextras\Orm\Exception\InvalidStateException; use NextrasTests\Orm\BookCollection; use NextrasTests\Orm\DataTestCase; use NextrasTests\Orm\Helper; diff --git a/tests/cases/integration/Model/model.refreshAll.phpt b/tests/cases/integration/Model/model.refreshAll.phpt index 62342d52..aacb2bc2 100644 --- a/tests/cases/integration/Model/model.refreshAll.phpt +++ b/tests/cases/integration/Model/model.refreshAll.phpt @@ -9,7 +9,7 @@ namespace NextrasTests\Orm\Integration\Model; use Nextras\Dbal\IConnection; -use Nextras\Orm\InvalidStateException; +use Nextras\Orm\Exception\InvalidStateException; use NextrasTests\Orm\DataTestCase; use NextrasTests\Orm\EanType; use NextrasTests\Orm\Helper; diff --git a/tests/cases/integration/Relationships/entity.relationships.phpt b/tests/cases/integration/Relationships/entity.relationships.phpt index 2a522975..4657883e 100644 --- a/tests/cases/integration/Relationships/entity.relationships.phpt +++ b/tests/cases/integration/Relationships/entity.relationships.phpt @@ -11,7 +11,7 @@ namespace NextrasTests\Orm\Integration\Relationships; use Nextras\Dbal\Connection; use Nextras\Dbal\IConnection; use Nextras\Dbal\Utils\CallbackQueryLogger; -use Nextras\Orm\LogicException; +use Nextras\Orm\Exception\LogicException; use NextrasTests\Orm\Author; use NextrasTests\Orm\Book; use NextrasTests\Orm\DataTestCase; diff --git a/tests/cases/integration/Relationships/relationships.cyclic.phpt b/tests/cases/integration/Relationships/relationships.cyclic.phpt index 6684373d..66122e16 100644 --- a/tests/cases/integration/Relationships/relationships.cyclic.phpt +++ b/tests/cases/integration/Relationships/relationships.cyclic.phpt @@ -8,7 +8,7 @@ namespace NextrasTests\Orm\Integration\Relationships; -use Nextras\Orm\InvalidStateException; +use Nextras\Orm\Exception\InvalidStateException; use NextrasTests\Orm\Author; use NextrasTests\Orm\Book; use NextrasTests\Orm\DataTestCase; diff --git a/tests/cases/integration/Repository/repository.cascadeRemove.phpt b/tests/cases/integration/Repository/repository.cascadeRemove.phpt index 849b20f2..22ade700 100644 --- a/tests/cases/integration/Repository/repository.cascadeRemove.phpt +++ b/tests/cases/integration/Repository/repository.cascadeRemove.phpt @@ -8,7 +8,7 @@ namespace NextrasTests\Orm\Integration\Repository; -use Nextras\Orm\InvalidStateException; +use Nextras\Orm\Exception\InvalidStateException; use NextrasTests\Orm\Book; use NextrasTests\Orm\Comment; use NextrasTests\Orm\DataTestCase; diff --git a/tests/cases/integration/Repository/repository.persistence.phpt b/tests/cases/integration/Repository/repository.persistence.phpt index 78a3ec65..bc7f9329 100644 --- a/tests/cases/integration/Repository/repository.persistence.phpt +++ b/tests/cases/integration/Repository/repository.persistence.phpt @@ -9,7 +9,7 @@ namespace NextrasTests\Orm\Integration\Repository; use Nextras\Dbal\Utils\DateTimeImmutable; -use Nextras\Orm\NullValueException; +use Nextras\Orm\Exception\NullValueException; use NextrasTests\Orm\Author; use NextrasTests\Orm\Book; use NextrasTests\Orm\Publisher; diff --git a/tests/cases/integration/Repository/repository.phpt b/tests/cases/integration/Repository/repository.phpt index 83878de5..4aefd911 100644 --- a/tests/cases/integration/Repository/repository.phpt +++ b/tests/cases/integration/Repository/repository.phpt @@ -8,7 +8,7 @@ namespace NextrasTests\Orm\Integration\Repository; -use Nextras\Orm\NoResultException; +use Nextras\Orm\Exception\NoResultException; use NextrasTests\Orm\Book; use NextrasTests\Orm\DataTestCase; use Tester\Assert; diff --git a/tests/cases/unit/Collection/ArrayCollectionTest.phpt b/tests/cases/unit/Collection/ArrayCollectionTest.phpt index a9b7ffd7..17f0b2a8 100644 --- a/tests/cases/unit/Collection/ArrayCollectionTest.phpt +++ b/tests/cases/unit/Collection/ArrayCollectionTest.phpt @@ -6,7 +6,7 @@ namespace NextrasTests\Orm\Collection; use DateTime; use Nextras\Orm\Collection\ArrayCollection; use Nextras\Orm\Collection\ICollection; -use Nextras\Orm\InvalidArgumentException; +use Nextras\Orm\Exception\InvalidArgumentException; use NextrasTests\Orm\Author; use NextrasTests\Orm\Book; use NextrasTests\Orm\TestCase; diff --git a/tests/cases/unit/Collection/ConditionParserHelperTest.phpt b/tests/cases/unit/Collection/ConditionParserHelperTest.phpt index ca60b6f1..ad7cd377 100644 --- a/tests/cases/unit/Collection/ConditionParserHelperTest.phpt +++ b/tests/cases/unit/Collection/ConditionParserHelperTest.phpt @@ -14,7 +14,7 @@ use Nextras\Orm\Collection\Functions\CompareNotEqualsFunction; use Nextras\Orm\Collection\Functions\CompareSmallerThanEqualsFunction; use Nextras\Orm\Collection\Functions\CompareSmallerThanFunction; use Nextras\Orm\Collection\Helpers\ConditionParser; -use Nextras\Orm\InvalidArgumentException; +use Nextras\Orm\Exception\InvalidArgumentException; use NextrasTests\Orm\Book; use NextrasTests\Orm\TestCase; use Tester\Assert; diff --git a/tests/cases/unit/Collection/FetchPairsHelperTest.phpt b/tests/cases/unit/Collection/FetchPairsHelperTest.phpt index 6bb62e38..48fd7f2f 100644 --- a/tests/cases/unit/Collection/FetchPairsHelperTest.phpt +++ b/tests/cases/unit/Collection/FetchPairsHelperTest.phpt @@ -10,8 +10,8 @@ namespace NextrasTests\Orm\Collection; use ArrayIterator; use Nextras\Dbal\Utils\DateTimeImmutable; use Nextras\Orm\Collection\Helpers\FetchPairsHelper; -use Nextras\Orm\InvalidArgumentException; -use Nextras\Orm\InvalidStateException; +use Nextras\Orm\Exception\InvalidArgumentException; +use Nextras\Orm\Exception\InvalidStateException; use NextrasTests\Orm\Author; use NextrasTests\Orm\Book; use NextrasTests\Orm\Currency; diff --git a/tests/cases/unit/Entity/AbstractEntity.properties.phpt b/tests/cases/unit/Entity/AbstractEntity.properties.phpt index 85a1a180..5ba35ff7 100644 --- a/tests/cases/unit/Entity/AbstractEntity.properties.phpt +++ b/tests/cases/unit/Entity/AbstractEntity.properties.phpt @@ -7,7 +7,7 @@ namespace NextrasTests\Orm\Entity\Fragments; -use Nextras\Orm\InvalidArgumentException; +use Nextras\Orm\Exception\InvalidArgumentException; use NextrasTests\Orm\Book; use NextrasTests\Orm\TestCase; use Tester\Assert; diff --git a/tests/cases/unit/Entity/AbstractEntity.repository.phpt b/tests/cases/unit/Entity/AbstractEntity.repository.phpt index 884737cd..be95c6ad 100644 --- a/tests/cases/unit/Entity/AbstractEntity.repository.phpt +++ b/tests/cases/unit/Entity/AbstractEntity.repository.phpt @@ -11,7 +11,7 @@ use Mockery; use Nextras\Orm\Entity\AbstractEntity; use Nextras\Orm\Entity\IEntity; use Nextras\Orm\Entity\Reflection\EntityMetadata; -use Nextras\Orm\InvalidStateException; +use Nextras\Orm\Exception\InvalidStateException; use Nextras\Orm\Repository\IRepository; use NextrasTests\Orm\TestCase; use Tester\Assert; diff --git a/tests/cases/unit/Entity/Reflection/MetadataParser.parseContainer.phpt b/tests/cases/unit/Entity/Reflection/MetadataParser.parseContainer.phpt index 7a248842..3e4fce64 100644 --- a/tests/cases/unit/Entity/Reflection/MetadataParser.parseContainer.phpt +++ b/tests/cases/unit/Entity/Reflection/MetadataParser.parseContainer.phpt @@ -9,9 +9,9 @@ namespace NextrasTests\Orm\Entity\Reflection; use Nextras\Orm\Entity\Entity; use Nextras\Orm\Entity\IProperty; +use Nextras\Orm\Entity\Reflection\InvalidModifierDefinitionException; use Nextras\Orm\Entity\Reflection\MetadataParser; use Nextras\Orm\Entity\Reflection\PropertyMetadata; -use Nextras\Orm\InvalidModifierDefinitionException; use NextrasTests\Orm\TestCase; use Tester\Assert; diff --git a/tests/cases/unit/Entity/Reflection/MetadataParserExceptionsTest.phpt b/tests/cases/unit/Entity/Reflection/MetadataParserExceptionsTest.phpt index 58d02a41..4393d974 100644 --- a/tests/cases/unit/Entity/Reflection/MetadataParserExceptionsTest.phpt +++ b/tests/cases/unit/Entity/Reflection/MetadataParserExceptionsTest.phpt @@ -7,9 +7,9 @@ namespace NextrasTests\Orm\Entity\Reflection; +use Nextras\Orm\Entity\Reflection\InvalidModifierDefinitionException; use Nextras\Orm\Entity\Reflection\MetadataParser; -use Nextras\Orm\InvalidModifierDefinitionException; -use Nextras\Orm\InvalidStateException; +use Nextras\Orm\Exception\InvalidStateException; use NextrasTests\Orm\TestCase; use Tester\Assert; diff --git a/tests/cases/unit/Entity/Reflection/ModifierParserTest.phpt b/tests/cases/unit/Entity/Reflection/ModifierParserTest.phpt index 38d7c4c6..bd8bbc59 100644 --- a/tests/cases/unit/Entity/Reflection/ModifierParserTest.phpt +++ b/tests/cases/unit/Entity/Reflection/ModifierParserTest.phpt @@ -8,8 +8,8 @@ namespace NextrasTests\Orm\Entity\Reflection; use Mockery; +use Nextras\Orm\Entity\Reflection\InvalidModifierDefinitionException; use Nextras\Orm\Entity\Reflection\ModifierParser; -use Nextras\Orm\InvalidModifierDefinitionException; use NextrasTests\Orm\TestCase; use ReflectionClass; use Tester\Assert; diff --git a/tests/cases/unit/Mapper/Dbal/DbalMapperTest.phpt b/tests/cases/unit/Mapper/Dbal/DbalMapperTest.phpt index 361b7ef9..26dd2678 100644 --- a/tests/cases/unit/Mapper/Dbal/DbalMapperTest.phpt +++ b/tests/cases/unit/Mapper/Dbal/DbalMapperTest.phpt @@ -11,7 +11,7 @@ use Mockery; use Nextras\Dbal\Result\Result; use Nextras\Dbal\Result\Row; use Nextras\Orm\Collection\ArrayCollection; -use Nextras\Orm\InvalidArgumentException; +use Nextras\Orm\Exception\InvalidArgumentException; use Nextras\Orm\Mapper\Dbal\Conventions\Conventions; use Nextras\Orm\Mapper\Dbal\DbalMapper; use Nextras\Orm\Repository\IRepository; diff --git a/tests/cases/unit/Model/MetadataStorageTest.phpt b/tests/cases/unit/Model/MetadataStorageTest.phpt index cd2be514..73de435c 100644 --- a/tests/cases/unit/Model/MetadataStorageTest.phpt +++ b/tests/cases/unit/Model/MetadataStorageTest.phpt @@ -8,8 +8,8 @@ namespace NextrasTests\Orm\Model; use Nextras\Orm\Entity\Reflection\EntityMetadata; -use Nextras\Orm\InvalidArgumentException; -use Nextras\Orm\InvalidStateException; +use Nextras\Orm\Exception\InvalidArgumentException; +use Nextras\Orm\Exception\InvalidStateException; use Nextras\Orm\Model\MetadataStorage; use NextrasTests\Orm\Book; use NextrasTests\Orm\TestCase; diff --git a/tests/cases/unit/Repository/IdentityMapTest.phpt b/tests/cases/unit/Repository/IdentityMapTest.phpt index 5e8eaee9..46ecb754 100644 --- a/tests/cases/unit/Repository/IdentityMapTest.phpt +++ b/tests/cases/unit/Repository/IdentityMapTest.phpt @@ -8,7 +8,7 @@ namespace NextrasTests\Orm\Repository; use Mockery; -use Nextras\Orm\InvalidArgumentException; +use Nextras\Orm\Exception\InvalidArgumentException; use Nextras\Orm\Repository\IdentityMap; use Nextras\Orm\Repository\IRepository; use NextrasTests\Orm\Author; diff --git a/tests/inc/DataTestCase.php b/tests/inc/DataTestCase.php index 7ce0ed9b..bf348b92 100644 --- a/tests/inc/DataTestCase.php +++ b/tests/inc/DataTestCase.php @@ -4,10 +4,9 @@ use Nextras\Dbal\IConnection; -use Nextras\Dbal\Result\Result; use Nextras\Dbal\Utils\CallbackQueryLogger; use Nextras\Dbal\Utils\FileImporter; -use Nextras\Orm\NotSupportedException; +use Nextras\Orm\Exception\NotSupportedException; class DataTestCase extends TestCase diff --git a/tests/inc/Helper.php b/tests/inc/Helper.php index bfd866ba..898a7b94 100644 --- a/tests/inc/Helper.php +++ b/tests/inc/Helper.php @@ -3,7 +3,7 @@ namespace NextrasTests\Orm; -use Nextras\Orm\InvalidStateException; +use Nextras\Orm\Exception\InvalidStateException; use Tester\Environment; use Tester\TestCase; diff --git a/tests/inc/setup.php b/tests/inc/setup.php index d6bf8862..40b1a4ec 100644 --- a/tests/inc/setup.php +++ b/tests/inc/setup.php @@ -5,7 +5,7 @@ use Nette\Neon\Neon; use Nextras\Dbal\Connection; use Nextras\Dbal\Utils\FileImporter; -use Nextras\Orm\InvalidStateException; +use Nextras\Orm\Exception\InvalidStateException; use NextrasTests\Orm\Helper;