Rs\Json\Patch\Operations\Replace::perform PHP Method

perform() public method

public perform ( string $targetDocument ) : string
$targetDocument string
return string
    public function perform($targetDocument)
    {
        $pointer = new Pointer($targetDocument);
        try {
            $get = $pointer->get($this->getPath());
        } catch (NonexistentValueReferencedException $e) {
            return $targetDocument;
        }
        $targetDocument = json_decode($targetDocument);
        $this->replace($targetDocument, $this->getPointerParts(), $this->getValue());
        return json_encode($targetDocument, JSON_UNESCAPED_UNICODE);
    }