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
UserCreatedEvent
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 UserCreatedEvent extends DomainEvent
12{
13    private const string TYPE = 'user.user.created';
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}

Paths

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

UserCreatedEvent->__construct
21    public function __construct(User $user, ?array $metadata = null)
22    {
23        parent::__construct(self::TYPE, $metadata);
24        $this->user = $user;
25    }
UserCreatedEvent->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 UserCreatedEvent extends DomainEvent
12{
13    private const string TYPE = 'user.user.created';
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    }