Skip to content

Remove @internal from MapperEvent#35

Merged
roxblnfk merged 5 commits intocycle:1.xfrom
gam6itko:mapper-event-not-internal
Aug 9, 2024
Merged

Remove @internal from MapperEvent#35
roxblnfk merged 5 commits intocycle:1.xfrom
gam6itko:mapper-event-not-internal

Conversation

@gam6itko
Copy link
Contributor

@gam6itko gam6itko commented Aug 8, 2024

🤔 Why?

this class triggers psalm error

use Cycle\ORM\Entity\Behavior\Attribute\Listen;
use Cycle\ORM\Entity\Behavior\Event\Mapper\Command;
use Cycle\ORM\Entity\Behavior\Event\Mapper\QueueCommand;

final class FooListener
{
    #[Listen(Command\OnCreate::class)]
    #[Listen(Command\OnUpdate::class)]
    public function onEvent(QueueCommand $event)
    {
        assert($event->entity instanceof MySuperBarClass);
        // do things
    }
}
ERROR: InternalProperty
at /home/gam6itko/FooListener.php:x:y
Cycle\ORM\Entity\Behavior\Event\Mapper\QueueCommand::$entity is internal to Cycle but called from FooListener (see https://psalm.dev/176)
        assert($event->entity instanceof MySuperBarClass);

@roxblnfk roxblnfk merged commit 9b7ad13 into cycle:1.x Aug 9, 2024
@roxblnfk roxblnfk changed the title [psalm level 4 fix] MapperEvent remove @internal annotation Remove @internal from MapperEvent Aug 9, 2024
@gam6itko gam6itko deleted the mapper-event-not-internal branch August 12, 2024 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants