Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
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
AvatarUpdatedEvent
100.00% covered (success)
100.00%
3 / 3
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%
2 / 2
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
 getUser
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
1<?php
2
3namespace App\User\Domain\Event;
4
5use App\Shared\Domain\Event\DomainEvent;
6use App\User\Domain\Model\User;
7
8/**
9 * @author Wilhelm Zwertvaegher
10 */
11class AvatarUpdatedEvent extends DomainEvent
12{
13    private const string TYPE = 'user.avatar.updated';
14
15    private readonly User $user;
16
17    /**
18     * @param User $user
19     * @param array<string, string|int>|null $metadata
20     */
21    public function __construct(User $user, ?array $metadata = null)
22    {
23        parent::__construct(self::TYPE, $metadata);
24        $this->user = $user;
25    }
26
27    public function getUser(): User
28    {
29        return $this->user;
30    }
31}

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.

AvatarUpdatedEvent->__construct
21    public function __construct(User $user, ?array $metadata = null)
22    {
23        parent::__construct(self::TYPE, $metadata);
24        $this->user = $user;
25    }
AvatarUpdatedEvent->getUser
29        return $this->user;
30    }
{main}
3namespace App\User\Domain\Event;
4
5use App\Shared\Domain\Event\DomainEvent;
6use App\User\Domain\Model\User;
7
8/**
9 * @author Wilhelm Zwertvaegher
10 */
11class AvatarUpdatedEvent extends DomainEvent
12{
13    private const string TYPE = 'user.avatar.updated';
14
15    private readonly User $user;
16
17    /**
18     * @param User $user
19     * @param array<string, string|int>|null $metadata
20     */
21    public function __construct(User $user, ?array $metadata = null)
22    {
23        parent::__construct(self::TYPE, $metadata);
24        $this->user = $user;
25    }
26
27    public function getUser(): User
28    {
29        return $this->user;
30    }