src/Support/Content/UploadedContentInterpreter.php
public function interpret(RawContentInterface $content)
    {
        // Treat any string longer than 2048 characters as full data
        if (    $content->size() <= static::FULL_DATA_THRESHOLD
            && filter_var($content->content(), FILTER_VALIDATE_URL)
        ) {
            return ContentTypes::URI;
        }

        // Detect data uri
        if (preg_match(static::DATAURI_REGEX, $content->chunk(0, static::DATAURI_TEST_CHUNK))) {
            return ContentTypes::DATAURI;
        }

        return ContentTypes::RAW;
    }
public function interpret(RawContentInterface $content)
    {
        // Treat any string longer than 2048 characters as full data
        if (    $content->size() <= static::FULL_DATA_THRESHOLD
            && filter_var($content->content(), FILTER_VALIDATE_URL)
        ) {
            return ContentTypes::URI;
        }

        // Detect data uri
        if (preg_match(static::DATAURI_REGEX, $content->chunk(0, static::DATAURI_TEST_CHUNK))) {
            return ContentTypes::DATAURI;
        }

        return ContentTypes::RAW;
    }
public function interpret ( RawContentInterface $ content ) { // Treat any string longer than 2048 characters as full data if ( $ content -> size ( ) <= static :: FULL_DATA_THRESHOLD && filter_var ( $ content -> content ( ) , FILTER_VALIDATE_URL ) ) { return ContentTypes :: URI ; } // Detect data uri if ( preg_match ( static :: DATAURI_REGEX , $ content -> chunk ( 0 , static :: DATAURI_TEST_CHUNK ) ) ) { return ContentTypes :: DATAURI ; } return ContentTypes :: RAW ; }
Returns which type the given content is deemed to be.

@param RawContentInterface $content
@return string
@see ContentTypes
Returns which type the given content is deemed to be .