diff --git a/EventSubscriber/ReadOnlySubscriber.php b/EventSubscriber/ReadOnlySubscriber.php index f1d770d..ec4d779 100644 --- a/EventSubscriber/ReadOnlySubscriber.php +++ b/EventSubscriber/ReadOnlySubscriber.php @@ -5,7 +5,6 @@ use Doctrine\ORM\Event\OnClassMetadataNotFoundEventArgs; use steevanb\DoctrineReadOnlyHydrator\Hydrator\SimpleObjectHydrator; use Doctrine\Common\EventSubscriber; -use Doctrine\Common\Persistence\Event\LifecycleEventArgs; use Doctrine\ORM\Event\PreFlushEventArgs; use Doctrine\ORM\Events; use steevanb\DoctrineReadOnlyHydrator\Entity\ReadOnlyEntityInterface; @@ -26,10 +25,10 @@ public function getSubscribedEvents() } /** - * @param LifecycleEventArgs $args + * @param \Doctrine\Common\Persistence\Event\LifecycleEventArgs|\Doctrine\ORM\Event\LifecycleEventArgs $args * @throws ReadOnlyEntityCantBePersistedException */ - public function prePersist(LifecycleEventArgs $args) + public function prePersist($args) { if ($this->isReadOnlyEntity($args->getObject())) { throw new ReadOnlyEntityCantBePersistedException($args->getObject()); @@ -70,8 +69,8 @@ public function onClassMetadataNotFound(OnClassMetadataNotFoundEventArgs $eventA } catch (\Exception $exception) {} } - /** @param LifecycleEventArgs $eventArgs */ - public function postLoad(LifecycleEventArgs $eventArgs) + /** @param \Doctrine\Common\Persistence\Event\LifecycleEventArgs|\Doctrine\ORM\Event\LifecycleEventArgs $eventArgs */ + public function postLoad($eventArgs) { if ($eventArgs->getObject() instanceof ReadOnlyEntityInterface) { // add ReadOnlyProxy to classMetada list diff --git a/changelog.md b/changelog.md index c208579..7373360 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,8 @@ +### [2.4.0](../../compare/2.3.0...2.4.0) (2021-10-19) + +- Update dependency: `doctrine/orm` from `^2.4.8` to `^2.5`, it was not working with `2.4` +- Add dependencies (it was already used by previous version): `doctrine/collections` + ### [2.3.0](../../compare/2.2.4...2.3.0) (2021-03-28) - [lerminou](https://github.com/lerminou) Allow PHP8 in `composer.json` diff --git a/composer.json b/composer.json index ae3ea43..0dcc69c 100644 --- a/composer.json +++ b/composer.json @@ -3,16 +3,23 @@ "license": "MIT", "description": "Fast hydratation for read only purpose", "autoload": { - "psr-4": { "steevanb\\DoctrineReadOnlyHydrator\\": "" }, + "psr-4": { + "steevanb\\DoctrineReadOnlyHydrator\\": "" + }, "exclude-from-classmap": [ "/ComposerOverloadClass/" ] }, "require": { - "php" : "^5.4.6 || ^7.0 || ^8.0", - "doctrine/orm": "^2.4.8" + "php": "^5.4.6 || ^7.0 || ^8.0", + "ext-tokenizer": "*", + "doctrine/collections": "^1.1", + "doctrine/orm": "^2.5" }, "suggest": { - "steevanb/doctrine-stats": "Add Doctrine stats : hydration time, lazy loaded entities, managed entities etc." + "steevanb/doctrine-stats": "Add Doctrine stats: hydration time, lazy loaded entities, managed entities etc." + }, + "config": { + "sort-packages": true } }