private function parseAttributeType(Input $definition): ?string
    {
        $maxLength = self::MAX_ATTRIBUTE_TYPE_LENGTH;

        if ($definition->peek() !== ":") {
            return null;
        }

        $definition->take();

        $type = $definition->takeAllAlphaNumUntil("}");

        if (empty($type)) {
            throw InvalidRoute::emptyAttributeType($definition);
        }

        if (strlen($type) > $maxLength) {
            throw InvalidRoute::longAttributeType($definition, $maxLength);
        }

        return $type;
    }
private function parseAttributeType(Input $definition): ?string
    {
        $maxLength = self::MAX_ATTRIBUTE_TYPE_LENGTH;

        if ($definition->peek() !== ":") {
            return null;
        }

        $definition->take();

        $type = $definition->takeAllAlphaNumUntil("}");

        if (empty($type)) {
            throw InvalidRoute::emptyAttributeType($definition);
        }

        if (strlen($type) > $maxLength) {
            throw InvalidRoute::longAttributeType($definition, $maxLength);
        }

        return $type;
    }
private function parseAttributeType ( Input $ definition ) : ? string { $ maxLength = self :: MAX_ATTRIBUTE_TYPE_LENGTH ; if ( $ definition -> peek ( ) !== ":" ) { return null ; } $ definition -> take ( ) ; $ type = $ definition -> takeAllAlphaNumUntil ( "}" ) ; if ( empty ( $ type ) ) { throw InvalidRoute :: emptyAttributeType ( $ definition ) ; } if ( strlen ( $ type ) > $ maxLength ) { throw InvalidRoute :: longAttributeType ( $ definition , $ maxLength ) ; } return $ type ; }
Parse the attribute type.

@param Input $definition
@return null|string
@throws InvalidRoute
@throws UnexpectedChar
Parse the attribute type .