Deserializes a goal state document.

@return GoalState
545462
public function deserialize()
    {
        do {
            $lengthString = stream_get_line($this->_inputStream, 100, "\n");
        } while (
            empty($lengthString) || $lengthString == "\n" || $lengthString == "\r"
        );

        $intLengthString = hexdec(trim($lengthString));

        $chunkData = stream_get_contents($this->_inputStream, $intLengthString);
        $goalState = $this->_deserializer->deserialize($chunkData);

        return $goalState;
    }
14144
public function jsonSerialize() {
    $valid =
      (!isset($this->initialAlpha) ||
        $this->validateInitialAlpha($this->initialAlpha)) &&
      (!isset($this->initialScale) ||
        $this->validateInitialScale($this->initialScale));
    if (!$valid) {
      return NULL;
    }
    return parent::jsonSerialize();
  }
562756
protected function getState()
    {
        $serviceService = $this->getServiceLocator()->get(StateStorage::SERVICE_ID);
        $userUri = $this->getSession()->getUserUri();
        return is_null($userUri) ? null : $serviceService->get($userUri, $this->getServiceCallId());
    }
992726
public function read()
    {
        $batch = [OP_RECV_MESSAGE => true];
        if ($this->metadata === null) {
            $batch[OP_RECV_INITIAL_METADATA] = true;
        }
        $read_event = $this->call->startBatch($batch);
        if ($this->metadata === null) {
            $this->metadata = $read_event->metadata;
        }

        return $this->_deserializeResponse($read_event->message);
    }
1310692
public function getState()
    {
        if (empty($this->state)) {
            $this->setState(
                rtrim(
                    base64_encode(uniqid('', true)),
                    '='
                )
            );
        }
        return $this->state;
    }
254092
public function getRev()
    {
        if ($this->_receive) {
            return $this;
        }
        $postStr = !empty($this->postxml) ? $this->postxml : file_get_contents("php://input");
        if (!empty($postStr)) {
            $disableEntities = libxml_disable_entity_loader(true);
            $this->_receive = (array)simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
            libxml_disable_entity_loader($disableEntities);
        }
        return $this;
    }
702298
public function deserialize(): object
    {
        $this->buffer->position($this->assetOffset / 2);

        $voteLength = $this->buffer->readUInt8() & 0xff;

        $this->transaction->asset = ['votes' => []];

        $vote = null;
        for ($i = 0; $i < $voteLength; $i++) {
            $this->buffer->position($this->assetOffset + 2 + $i * 2 * 34);

            $vote = $this->buffer->readHexRaw(34 * 2);
            $vote = ('1' === $vote[1] ? '+' : '-').substr($vote, 2);
            $this->transaction->asset['votes'][] = $vote;
        }

        return $this->parseSignatures($this->assetOffset + 2 + $voteLength * 34 * 2);
    }
995695
protected function plaintextState() {
		$this->emitRawTextRange( true, $this->pos, $this->length - $this->pos );
		return self::STATE_EOF;
	}
1043853
public function getStateDetails(): StateInterface
    {
        $data = $this->soap("AVTransport", "GetPositionInfo");

        # Check for line in mode
        if ($data["TrackMetaData"] === "NOT_IMPLEMENTED") {
            $state = new State($data["TrackURI"]);
            $state->setStream(new Stream("x-rincon-stream:" . $this->getUuid(), "Line-In"));
            return $state;
        }

        # Check for an empty queue
        if (!$data["TrackMetaData"]) {
            return new State();
        }

        $parser = new XmlParser($data["TrackMetaData"]);
        $state = State::createFromXml($parser->getTag("item"), $this);

        if ((string) $parser->getTag("streamContent")) {
            $info = $this->getMediaInfo();
            $meta = new XmlParser($info["CurrentURIMetaData"]);
            if ($title = (string) $meta->getTag("title")) {
                $state->setStream(new Stream("", $title));
            } else {
                $state->setStream(new Stream("", $parser->getTag("title")));
            }
        }

        $state->setNumber($data["Track"]);
        $state->setDuration(Time::parse($data["TrackDuration"]));
        $state->setPosition(Time::parse($data["RelTime"]));

        # If we have a queue number, it'll be one-based, rather than zero-based, so convert it
        if ($state->getNumber() > 0) {
            $state->setNumber($state->getNumber() - 1);
        }

        return $state;
    }
140043
public function deSerialize()
    {
        $legacySaveFile = sprintf('%s/%s', $this->path, static::LEGACY_SAVE_FILE);
        if (file_exists($legacySaveFile)) {
            $userState = $this->migrateData($legacySaveFile);

            if ($userState instanceof UserState) {
                return $userState;
            }
        }

        $json = $this->readJson(sprintf('%s/%s', $this->path, static::SAVE_FILE));
        if (null === $json) {
            $this->wipeFile();
            return new UserState();
        }

        if (!isset($json[$this->workshopName])) {
            return new UserState();
        }

        $json = $json[$this->workshopName];
        if (!array_key_exists('completed_exercises', $json)) {
            return new UserState();
        }

        if (!array_key_exists('current_exercise', $json)) {
            return new UserState();
        }

        if (!is_array($json['completed_exercises'])) {
            $json['completed_exercises'] = [];
        }

        foreach ($json['completed_exercises'] as $i => $exercise) {
            if (!is_string($exercise)) {
                unset($json['completed_exercises'][$i]);
            }
        }

        if (null !== $json['current_exercise'] && !is_string($json['current_exercise'])) {
            $json['current_exercise'] = null;
        }

        return new UserState(
            $json['completed_exercises'],
            $json['current_exercise']
        );
    }
1031128
public function finish()
    {
        if ( $this->parserState != self::PARSE_STATE_POST_LAST )
        {
            // this should never happen
            // let's give the last parser a chance to clean up after himself
            if ( $this->currentPartParser !== null )
            {
                $part = $this->currentPartParser->finish();
                $this->partDone( $part );
                $this->currentPartParser = null;
            }
        }
        $multipart = $this->finishMultipart();
        ezcMailPartParser::parsePartHeaders( $this->headers, $multipart );
        $multipart->boundary = $this->boundary;
        return $multipart;
    }
346259
public function deserialize($content, $documentClass)
    {
        try {
            $record = $this->deserializeContent(
                $content,
                $documentClass
            );
        } catch (\Exception $e) {
            throw new DeserializationException("Deserialization failed", $e);
        }

        return $record;
    }
447787
protected function getDefaultObjectStates()
    {
        $defaultObjectStatesMap = array();
        $objectStateHandler = $this->persistenceHandler->objectStateHandler();

        foreach ($objectStateHandler->loadAllGroups() as $objectStateGroup) {
            foreach ($objectStateHandler->loadObjectStates($objectStateGroup->id) as $objectState) {
                // Only register the first object state which is the default one.
                $defaultObjectStatesMap[$objectStateGroup->id] = $objectState;
                break;
            }
        }

        return $defaultObjectStatesMap;
    }
1135758
public function perform($targetDocument)
    {
        $pointer = new Pointer($targetDocument);
        $rootGet = array();
        $value = $this->getValue();

        try {
            $get = $pointer->get($this->getPath());
        } catch (NonexistentValueReferencedException $e) {
            $get = null;
        }

        $pointerParts = $this->getPointerParts();

        $rootPointer = $pointerParts[0];

        if (count($pointerParts) >= 2) {
            try {
                $rootGet = $pointer->get(Pointer::POINTER_CHAR . implode('/', array_slice($pointerParts, 0, -1)));
            } catch (NonexistentValueReferencedException $e) {
                return $targetDocument;
            }
        }

        $targetDocument = json_decode($targetDocument);

        $lastPointerPart = $pointerParts[count($pointerParts) - 1];
        $replacementValue = $this->getReplacementValue();

        if ($get === null && $lastPointerPart !== Pointer::LAST_ARRAY_ELEMENT_CHAR) {
            if (ctype_digit($lastPointerPart) && $lastPointerPart > count($rootGet)) {
                if ($rootPointer == $lastPointerPart && is_array($targetDocument)) {
                    if ((int) $lastPointerPart <= count($targetDocument) + 1) {
                        array_splice($targetDocument, $lastPointerPart, 0, $replacementValue);
                    }
                }
                return json_encode($targetDocument, JSON_UNESCAPED_UNICODE);
            }
            if (count($pointerParts) === 1) {
                if (is_array($targetDocument)) {
                    $targetDocument[$pointerParts[0]] = $value;
                } else {
                    $targetDocument->{$pointerParts[0]} = $value;
                }
            } elseif (count($pointerParts) > 1) {
                $augmentedDocument = &$targetDocument;
                foreach ($pointerParts as $pointerPart) {
                    if (is_array($augmentedDocument)) {
                        $augmentedDocument = &$augmentedDocument[$pointerPart];
                    } else {
                        $augmentedDocument = &$augmentedDocument->{$pointerPart};
                    }
                }
                $augmentedDocument = $value;
            }
        } else {
            $additionIndex = array_pop($pointerParts);
            $arrayEntryPath = '/' . implode('/', $pointerParts);

            try {
                $targetArray = $pointer->get($arrayEntryPath);
            } catch (NonexistentValueReferencedException $e) {
                $targetArray = null;
            }

            if (is_array($targetArray)) {
                if ($lastPointerPart === Pointer::LAST_ARRAY_ELEMENT_CHAR) {
                    $targetArray[] = $value;
                } else {
                    if (is_numeric($additionIndex)) {
                        array_splice($targetArray, $additionIndex, 0, $replacementValue);
                    } else {
                        $targetArray[$additionIndex] = $value;
                    }
                }
            }

            if (is_object($targetArray)) {
                $targetArray->{$additionIndex} = $value;
            }

            if (is_array($targetArray) || is_object($targetArray)) {
                $augmentedDocument = &$targetDocument;
                foreach ($pointerParts as $pointerPart) {
                    if (is_array($augmentedDocument)) {
                        $augmentedDocument = &$augmentedDocument[$pointerPart];
                    } else {
                        $augmentedDocument = &$augmentedDocument->{$pointerPart};
                    }
                }
                $augmentedDocument = $targetArray;
            }

            if ($targetArray === null) {
                if (is_numeric($additionIndex) && count($targetDocument) > 0) {
                    array_splice($targetDocument, $additionIndex, 0, $replacementValue);
                } else {
                    $targetDocument->{$additionIndex} = $value;
                }
            }
        }

        return json_encode($targetDocument, JSON_UNESCAPED_UNICODE);
    }
1222674
public function getObjectStateService()
    {
        if ($this->objectStateService !== null) {
            return $this->objectStateService;
        }

        $this->objectStateService = new ObjectStateService(
            $this,
            $this->persistenceHandler->objectStateHandler(),
            $this->serviceSettings['objectState']
        );

        return $this->objectStateService;
    }
578845
protected function deserializer()
    {
        if (null === $this->deserializer) {
            $self = $this;
            $this->deserializer = Closure::bind($this->bindDeserializer(), null, $this->class);
        }
        return $this->deserializer;
    }
30198
private Object deserialize() {
    SerializingTranscoder tc = new SerializingTranscoder();
    CachedData d = new CachedData(this.getItemFlags(), this.getValue(),
      CachedData.MAX_SIZE);
    Object rv = null;
    rv = tc.decode(d);
    return rv;
  }