Skip to content

Commit 5db3fb5

Browse files
Merge pull request #4 from t-kanstantsin/patch-refactoring
Patch refactoring
2 parents 4282dc1 + 474e25e commit 5db3fb5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Enum.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ abstract class Enum
2626
*
2727
* @var string|NULL
2828
*/
29-
protected static $attribute = NULL;
29+
protected static $attribute;
3030

3131
/**
3232
* Get all items
@@ -57,7 +57,7 @@ private function __construct()
5757
*/
5858
public static function keys(): array
5959
{
60-
return array_keys(static::all());
60+
return \array_keys(static::all());
6161
}
6262

6363
/**
@@ -96,7 +96,7 @@ public static function getDefault(): string
9696
*/
9797
public static function has($model, $key): bool
9898
{
99-
if (is_object($model)) {
99+
if (\is_object($model)) {
100100
if ($attribute = static::$attribute) {
101101
return $model->$attribute == $key;
102102
}
@@ -117,12 +117,12 @@ public static function has($model, $key): bool
117117
*/
118118
public static function hasIn($model, array $keys): bool
119119
{
120-
if (is_object($model)) {
120+
if (\is_object($model)) {
121121
if ($attribute = static::$attribute) {
122-
return \in_array($model->$attribute, $keys);
122+
return \in_array($model->$attribute, $keys, false);
123123
}
124124
} else {
125-
return \in_array($model, $keys);
125+
return \in_array($model, $keys, false);
126126
}
127127

128128
return false;

0 commit comments

Comments
 (0)