$maxNesting) { return false; } foreach ($segments as $segment) { if (!self::validateName($segment)) { return false; } } return true; } }