Skip to content

Signup error DateTimeImmutable given #11

@xcaptain

Description

@xcaptain

on submit the signup form I got

Type error: Argument 2 passed to Ddd\Domain\Event\StoredEvent::__construct() must be an instance of DateTime, instance of DateTimeImmutable given, called in /home/joey/workbench/git/last-wishes/vendor/carlosbuenosvinos/ddd/src/Infrastructure/Application/Notification/DoctrineEventStore.php on line 19



    in StoredEvent.php line 34
    at StoredEvent->__construct('Lw\Domain\Model\User\UserRegistered', object(DateTimeImmutable), '{"user_id":{"id":"f62b75a0-76a1-481b-88e9-cbff0d66d0f1"},"occurred_on":{}}') in DoctrineEventStore.php line 19
    at DoctrineEventStore->append(object(UserRegistered)) in PersistDomainEventSubscriber.php line 21
    at PersistDomainEventSubscriber->handle(object(UserRegistered)) in DomainEventPublisher.php line 56
    at DomainEventPublisher->publish(object(UserRegistered)) in User.php line 64
    at User->__construct(object(UserId), 'joey@test.com', '123456') in SignUpUserService.php line 42
    at SignUpUserService->execute(object(SignUpUserRequest)) in TransactionalApplicationService.php line 42
    at TransactionalApplicationService->Ddd\Application\Service\{closure}(object(EntityManager))
    at call_user_func(object(Closure), object(EntityManager)) in EntityManager.php line 233
    at EntityManager->transactional(object(Closure)) in DoctrineSession.php line 32
    at DoctrineSession->executeAtomically(object(Closure)) in TransactionalApplicationService.php line 45
    at TransactionalApplicationService->execute(object(SignUpUserRequest)) in index.php line 45
    at {closure}(object(Request))
    at call_user_func_array(object(Closure), array(object(Request))) in HttpKernel.php line 139
    at HttpKernel->handleRaw(object(Request), '1') in HttpKernel.php line 62
    at HttpKernel->handle(object(Request), '1', true) in Application.php line 586
    at Application->handle(object(Request)) in Application.php line 563
    at Application->run() in index.php line 242

I'm using php7, please update https://github.com/dddinphp/ddd/blob/master/src/Domain/Event/StoredEvent.php#L34 thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions