Passed
Pull Request — master (#1620)
by Tarmo
63:23
created

GetValues   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 8
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getValues() 0 3 1
1
<?php
2
declare(strict_types = 1);
3
/**
4
 * /src/Enum/Traits/GetValues.php
5
 *
6
 * @author TLe, Tarmo Leppänen <[email protected]>
7
 */
8
9
namespace App\Enum\Traits;
10
11
use function array_map;
12
13
/**
14
 * Trait GetValues
15
 *
16
 * @package App\Enum\Traits
17
 * @author TLe, Tarmo Leppänen <[email protected]>
18
 */
19
trait GetValues
20
{
21
    /**
22
     * @return array<int, string>
23
     */
24
    public static function getValues(): array
25
    {
26
        return array_map(static fn (self $enum): string => $enum->value, self::cases());
27
    }
28
}
29