'table', Application::NODE_TYPE_VIEW => 'view', default => throw new InvalidArgumentException('Invalid node type'), }; } /** * @throws InvalidArgumentException */ public static function stringNodeType2Const(string $nodeType): int { return match ($nodeType) { 'table', 'tables' => Application::NODE_TYPE_TABLE, 'view', 'views' => Application::NODE_TYPE_VIEW, default => throw new InvalidArgumentException('Invalid node type'), }; } }