Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
NamedTypeMetadata
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
2 / 2
3
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
 describe
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
2
1<?php
2
3declare(strict_types=1);
4
5namespace Celemas\Quma\Hydration;
6
7use BackedEnum;
8
9/** @internal */
10final readonly class NamedTypeMetadata
11{
12    /**
13     * @param non-empty-string $name
14     * @param class-string|null $class
15     * @param 'int'|'float'|'bool'|'string'|null $scalar
16     * @param 'immutable'|'mutable'|null $date
17     * @param class-string<BackedEnum>|null $enum
18     */
19    // @mago-expect lint:excessive-parameter-list Metadata mirrors the normalized named type shape.
20    public function __construct(
21        public string $name,
22        public bool $builtin,
23        public ?string $class,
24        public ?string $scalar,
25        public ?string $date,
26        public ?string $enum,
27    ) {}
28
29    public function describe(): string
30    {
31        return $this->builtin ? $this->name : $this->class ?? $this->name;
32    }
33}

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.

NamedTypeMetadata->__construct
21        public string $name,
22        public bool $builtin,
23        public ?string $class,
24        public ?string $scalar,
25        public ?string $date,
26        public ?string $enum,
27    ) {}
NamedTypeMetadata->describe
31        return $this->builtin ? $this->name : $this->class ?? $this->name;
31        return $this->builtin ? $this->name : $this->class ?? $this->name;
31        return $this->builtin ? $this->name : $this->class ?? $this->name;
31        return $this->builtin ? $this->name : $this->class ?? $this->name;
32    }