Passed
Push — master ( 8b9923...b95d07 )
by Mostafa
03:05 queued 36s
created

CacheEnum::equals()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 2
nc 2
nop 1
1
<?php
2
3
namespace Mostafaznv\LaraCache\Utils;
4
5
abstract class CacheEnum
6
{
7
    public function __construct(protected int|string $value) {}
8
9
    public static function __callStatic(string $name, array $arguments): self
10
    {
11
        return new static($name);
12
    }
13
14
    public function equals(self $other): bool
15
    {
16
        return get_class($this) === get_class($other) and $this->value === $other->value;
17
    }
18
}
19