@@ 41-51 (lines=11) @@ | ||
38 | return new static($value); |
|
39 | } |
|
40 | ||
41 | public static function __callStatic(string $methodName, array $arguments): self |
|
42 | { |
|
43 | foreach (self::getConstants() as $option => $value) { |
|
44 | $expectedMethodName = lcfirst(Inflector::classify(strtolower($option))); |
|
45 | if ($expectedMethodName === $methodName) { |
|
46 | return new static($value); |
|
47 | } |
|
48 | } |
|
49 | ||
50 | throw new BadMethodCallException(sprintf('%s::%s() does not exist', static::class, $methodName)); |
|
51 | } |
|
52 | ||
53 | public function __call(string $methodName, array $arguments) |
|
54 | { |
|
@@ 53-62 (lines=10) @@ | ||
50 | throw new BadMethodCallException(sprintf('%s::%s() does not exist', static::class, $methodName)); |
|
51 | } |
|
52 | ||
53 | public function __call(string $methodName, array $arguments) |
|
54 | { |
|
55 | foreach (self::getConstants() as $option => $value) { |
|
56 | $isaMethodName = 'is' . ucfirst(Inflector::classify(strtolower($option))); |
|
57 | if ($isaMethodName === $methodName) { |
|
58 | return $this->equals(static::get($value)); |
|
59 | } |
|
60 | } |
|
61 | throw new BadMethodCallException(sprintf('%s::%s() does not exist', static::class, $methodName)); |
|
62 | } |
|
63 | ||
64 | ||
65 | /** |