Skip to content

Commit fa1b42a

Browse files
authored
Few Optimization (#321)
1 parent df6b1ff commit fa1b42a

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

src/Enum/InvocationType.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ class InvocationType
1010

1111
public static function exists(string $value): bool
1212
{
13-
$values = [
13+
return isset([
1414
self::DRY_RUN => true,
1515
self::EVENT => true,
1616
self::REQUEST_RESPONSE => true,
17-
];
18-
19-
return isset($values[$value]);
17+
][$value]);
2018
}
2119
}

src/Enum/LogType.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ class LogType
99

1010
public static function exists(string $value): bool
1111
{
12-
$values = [
12+
return isset([
1313
self::NONE => true,
1414
self::TAIL => true,
15-
];
16-
17-
return isset($values[$value]);
15+
][$value]);
1816
}
1917
}

src/Enum/Runtime.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Runtime
2727

2828
public static function exists(string $value): bool
2929
{
30-
$values = [
30+
return isset([
3131
self::DOTNETCORE_1_0 => true,
3232
self::DOTNETCORE_2_0 => true,
3333
self::DOTNETCORE_2_1 => true,
@@ -48,8 +48,6 @@ public static function exists(string $value): bool
4848
self::PYTHON_3_8 => true,
4949
self::RUBY_2_5 => true,
5050
self::RUBY_2_7 => true,
51-
];
52-
53-
return isset($values[$value]);
51+
][$value]);
5452
}
5553
}

0 commit comments

Comments
 (0)