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%
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
WordGender
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
100.00% covered (success)
100.00%
1 / 1
 fromString
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
1<?php
2
3namespace App\Enum;
4
5/**
6 * @author Wilhelm Zwertvaegher
7 */
8enum WordGender: string implements Enum
9{
10    case M = 'M';
11    case F = 'F';
12    // by definition no defined gender, which means it can be used as both M and F
13    case NEUTRAL = 'NEUTRAL';
14    // gender may be automatically adapted with a locale based strategy
15    case AUTO = 'AUTO';
16
17    public static function fromString(string $value): WordGender
18    {
19        $normalized = strtoupper($value);
20
21        return self::from($normalized);
22    }
23}

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.

WordGender->fromString
17    public static function fromString(string $value): WordGender
18    {
19        $normalized = strtoupper($value);
20
21        return self::from($normalized);
22    }