biig-io / biig-io/DomainComponent

execute method should expect an interface

Open
#77 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
16
Forks
9
PR merge metrics
No merged PRs in 30d

Description

Currently to have a good code in rules, we need to check if the event is an instance of the event we expect. (required at least by phpstan)

We could improve the situation by replacing DomainEvent by DomainEventInterface, because we can use children interface as type afterwards.

Contributor guide

Open the contributing guide

Research direction

Start at the execute method and trace how DomainEvent is used in its parameter type and in the rules that consume events. Replace the expected type with DomainEventInterface, verify that child interfaces can be accepted, and run the existing test suite and PHPStan checks to confirm the typing remains valid.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.