*/ final readonly class UnfollowSourceHandler implements CommandHandler { public function __construct( private FollowedSourceRepository $followedSourceRepository ) { } public function __invoke(UnfollowSource $command): void { $followedSource = $this->followedSourceRepository->getByUserId( $command->userId, $command->sourceId ); if (! $followedSource instanceof FollowedSource) { throw FollowedSourceNotFound::with($command->userId, $command->sourceId); } $this->followedSourceRepository->remove($followedSource); } }