Rs\Json\Patch\Document::extractPatchOperations PHP Method

extractPatchOperations() private method

private extractPatchOperations ( string $patchDocument ) : Operation[]
$patchDocument string The patch document containing the patch operations.
return Operation[]
    private function extractPatchOperations($patchDocument)
    {
        $patchDocument = json_decode($patchDocument);
        if ($this->isEmptyPatchDocument($patchDocument)) {
            $exceptionMessage = sprintf("Unable to extract patch operations from '%s'", json_encode($patchDocument));
            throw new InvalidOperationException($exceptionMessage);
        }
        $patchOperations = array();
        foreach ($patchDocument as $index => $possiblePatchOperation) {
            $operation = $this->patchOperationFactory($possiblePatchOperation);
            if ($operation instanceof Operation) {
                $patchOperations[] = $operation;
            }
        }
        return $patchOperations;
    }