mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-03-31 19:08:41 +00:00
allow to get arguments by index
This commit is contained in:
parent
c5cd5da5d9
commit
960fdfcfe9
|
|
@ -269,6 +269,10 @@ final class ArrayUtils
|
|||
*/
|
||||
public static function getArg(string $id, array $args) : ?string
|
||||
{
|
||||
if (\is_numeric($id)) {
|
||||
return $args[(int) $id] ?? null;
|
||||
}
|
||||
|
||||
if (($key = \array_search($id, $args)) === false || $key === \count($args) - 1) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user