fix: checking existing argument with equal sign

This commit is contained in:
Marek Mencl
2024-01-02 14:26:45 +01:00
parent 86a96dd157
commit f004591c5a
4 changed files with 47 additions and 3 deletions

View File

@ -16,7 +16,17 @@ trait HandleArguments
*/
public function hasArgument(string $argument, array $arguments): bool
{
return in_array($argument, $arguments, true);
foreach ($arguments as $arg) {
if ($arg === $argument) {
return true;
}
if (str_starts_with($arg, "$argument=")) {
return true;
}
}
return false;
}
/**