Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
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
CRAP
100.00% covered (success)
100.00%
1 / 1
EnumConverter
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
100.00% covered (success)
100.00%
1 / 1
 convert
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\Dto\Request;
4
5use App\Enum\Enum;
6
7/**
8 * @author Wilhelm Zwertvaegher
9 */
10class EnumConverter
11{
12    /**
13     * @template T of Enum
14     *
15     * @param class-string<T> $className
16     *
17     * @return T
18     *
19     * @throws \InvalidArgumentException|\ValueError
20     */
21    public function convert(string $className, string $value): Enum
22    {
23        return $className::fromString($value);
24    }
25}

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.

EnumConverter->convert
21    public function convert(string $className, string $value): Enum
22    {
23        return $className::fromString($value);
24    }
{main}
3namespace App\Dto\Request;
4
5use App\Enum\Enum;
6
7/**
8 * @author Wilhelm Zwertvaegher
9 */
10class EnumConverter
11{
12    /**
13     * @template T of Enum
14     *
15     * @param class-string<T> $className
16     *
17     * @return T
18     *
19     * @throws \InvalidArgumentException|\ValueError
20     */
21    public function convert(string $className, string $value): Enum
22    {
23        return $className::fromString($value);
24    }