Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
AddUserSetHandler
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 __invoke
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace App\CollectionManagement\Application\Handler;
4
5use App\CollectionManagement\Application\Command\AddUserSetCommand;
6use App\CollectionManagement\Application\Command\SearchSetQuery;
7use App\CollectionManagement\Domain\Model\EnrichedSetCollection;
8use App\CollectionManagement\Domain\Model\Local\Set;
9use App\CollectionManagement\Domain\Model\Local\UserSet;
10use App\CollectionManagement\Domain\Service\RetrieveUserId;
11use App\CollectionManagement\Domain\Service\SetService;
12use App\Shared\Domain\Model\EntityId;
13use App\User\Domain\Model\User;
14
15final readonly class AddUserSetHandler
16{
17    public function __construct(private readonly RetrieveUserId $retrieveUser)
18    {
19    }
20
21    public function __invoke(AddUserSetCommand $command): UserSet
22    {
23        // get the user id associated to the command's identityId
24
25        $userId = $this->retrieveUser->getUserId($command->getIdentityId());
26
27        // add the event(s) to the message bus
28
29        // TODO
30        return new UserSet(
31            EntityId::generate(),
32            $userId,
33            new Set(EntityId::generate(), 'externalId', 'legoId', 'name', 10, '', 2005)
34        );
35    }
36}

Branches

Below are the source code lines that represent each code branch as identified by Xdebug. Please note a branch is not necessarily coterminous with a line, a line may contain multiple branches and therefore show up more than once. Please also be aware that some branches may be implicit rather than explicit, e.g. an if statement always has an else as part of its logical flow even if you didn't write one.

AddUserSetHandler->__construct
17    public function __construct(private readonly RetrieveUserId $retrieveUser)
18    {
19    }
AddUserSetHandler->__invoke
21    public function __invoke(AddUserSetCommand $command): UserSet
22    {
23        // get the user id associated to the command's identityId
24
25        $userId = $this->retrieveUser->getUserId($command->getIdentityId());
26
27        // add the event(s) to the message bus
28
29        // TODO
30        return new UserSet(
31            EntityId::generate(),
32            $userId,
33            new Set(EntityId::generate(), 'externalId', 'legoId', 'name', 10, '', 2005)
34        );
35    }
{main}
3namespace App\CollectionManagement\Application\Handler;
4
5use App\CollectionManagement\Application\Command\AddUserSetCommand;
6use App\CollectionManagement\Application\Command\SearchSetQuery;
7use App\CollectionManagement\Domain\Model\EnrichedSetCollection;
8use App\CollectionManagement\Domain\Model\Local\Set;
9use App\CollectionManagement\Domain\Model\Local\UserSet;
10use App\CollectionManagement\Domain\Service\RetrieveUserId;
11use App\CollectionManagement\Domain\Service\SetService;
12use App\Shared\Domain\Model\EntityId;
13use App\User\Domain\Model\User;
14
15final readonly class AddUserSetHandler
16{
17    public function __construct(private readonly RetrieveUserId $retrieveUser)
18    {
19    }
20
21    public function __invoke(AddUserSetCommand $command): UserSet
22    {
23        // get the user id associated to the command's identityId
24
25        $userId = $this->retrieveUser->getUserId($command->getIdentityId());
26
27        // add the event(s) to the message bus
28
29        // TODO
30        return new UserSet(
31            EntityId::generate(),
32            $userId,
33            new Set(EntityId::generate(), 'externalId', 'legoId', 'name', 10, '', 2005)
34        );
35    }