protected function extractMetadata($entryIdentifier, $content)
    {
        $separatorIndex = strpos($content, self::SEPARATOR);
        if ($separatorIndex === false) {
            $exception = new InvalidDataTypeException('Could not find cache metadata in entry with identifier ' . $entryIdentifier, 1433155925);
            if ($this->environment->getContext()->isProduction()) {
                $this->logger->logException($exception);
            } else {
                throw $exception;
            }
        }

        $metadataJson = substr($content, 0, $separatorIndex);
        $metadata = json_decode($metadataJson, true);
        if ($metadata === null) {
            $exception = new InvalidDataTypeException('Invalid cache metadata in entry with identifier ' . $entryIdentifier, 1433155926);
            if ($this->environment->getContext()->isProduction()) {
                $this->logger->logException($exception);
            } else {
                throw $exception;
            }
        }

        $this->metadata[$entryIdentifier] = $metadata;

        return substr($content, $separatorIndex + 1);
    }
protected function extractMetadata($entryIdentifier, $content)
    {
        $separatorIndex = strpos($content, self::SEPARATOR);
        if ($separatorIndex === false) {
            $exception = new InvalidDataTypeException('Could not find cache metadata in entry with identifier ' . $entryIdentifier, 1433155925);
            if ($this->environment->getContext()->isProduction()) {
                $this->logger->logException($exception);
            } else {
                throw $exception;
            }
        }

        $metadataJson = substr($content, 0, $separatorIndex);
        $metadata = json_decode($metadataJson, true);
        if ($metadata === null) {
            $exception = new InvalidDataTypeException('Invalid cache metadata in entry with identifier ' . $entryIdentifier, 1433155926);
            if ($this->environment->getContext()->isProduction()) {
                $this->logger->logException($exception);
            } else {
                throw $exception;
            }
        }

        $this->metadata[$entryIdentifier] = $metadata;

        return substr($content, $separatorIndex + 1);
    }
protected function extractMetadata ( $ entryIdentifier , $ content ) { $ separatorIndex = strpos ( $ content , self :: SEPARATOR ) ; if ( $ separatorIndex === false ) { $ exception = new InvalidDataTypeException ( 'Could not find cache metadata in entry with identifier ' . $ entryIdentifier , 1433155925 ) ; if ( $ this -> environment -> getContext ( ) -> isProduction ( ) ) { $ this -> logger -> logException ( $ exception ) ; } else { throw $ exception ; } } $ metadataJson = substr ( $ content , 0 , $ separatorIndex ) ; $ metadata = json_decode ( $ metadataJson , true ) ; if ( $ metadata === null ) { $ exception = new InvalidDataTypeException ( 'Invalid cache metadata in entry with identifier ' . $ entryIdentifier , 1433155926 ) ; if ( $ this -> environment -> getContext ( ) -> isProduction ( ) ) { $ this -> logger -> logException ( $ exception ) ; } else { throw $ exception ; } } $ this -> metadata [ $ entryIdentifier ] = $ metadata ; return substr ( $ content , $ separatorIndex + 1 ) ; }
Extract metadata from the content and store it

@param string $entryIdentifier The entry identifier
@param string $content The raw content including serialized metadata
@return string The content without metadata
@throws InvalidDataTypeException
Extract metadata from the content and store it