src/Domain/EventSourcedAggregateRoot.php
/**
     * Returns method belonging to event
     * @example UserWasRegistered ( event ) as param  $event
     * returns whenUserWasRegistered
     *
     * @param DomainEvent $event
     *
     * @return string
     */
Returns method belonging to event
@example UserWasRegistered ( event ) as param  $event
returns whenUserWasRegistered



@return string
Returns method belonging to event @example UserWasRegistered ( event ) as param $event returns whenUserWasRegistered @return string
protected function when(DomainEvent $event): string
    {
        $parts = explode('\\', get_class($event));
        return 'when' . end($parts);
    }
protected function when ( DomainEvent $ event ) : string { $ parts = explode ( '\\' , get_class ( $ event ) ) ; return 'when' . end ( $ parts ) ; }
Returns method belonging to event
 @example UserWasRegistered ( event ) as param  $event
 returns whenUserWasRegistered
Returns method belonging to event @example UserWasRegistered ( event ) as param $event returns whenUserWasRegistered