Passed
Pull Request — master (#56)
by Brent
01:34
created

EnumDefinition::equals()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 2
nc 2
nop 1
1
<?php
2
3
namespace Spatie\Enum;
4
5
class EnumDefinition
6
{
7
    /** @var mixed */
8
    public $value;
9
10
    public string $label;
11
12
    private string $methodName;
13
14
    public function __construct(string $methodName, string $value, string $label)
15
    {
16
        $this->methodName = $methodName;
17
        $this->value = $value;
18
        $this->label = $label;
19
    }
20
21
    public function equals($input): bool
22
    {
23
        return $this->value === $input
24
            || $this->methodName === $input;
25
    }
26
}
27