Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove @internal from MapperEvent #35

Merged
merged 5 commits into from
Aug 9, 2024

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
39 checks passed
@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