public function __construct($op, \stdClass $operation)
{
if (!class_exists('Rs\\Json\\Pointer')) {
$exceptionMessage = 'Unable to create JSON patch operation as ' . 'Json Pointer is not installed';
throw new \RuntimeException($exceptionMessage);
}
if (!property_exists($operation, 'path')) {
$exceptionMessage = sprintf("No path property set for patch operation '%s'", json_encode($operation));
throw new InvalidOperationException($exceptionMessage);
}
$this->name = $op;
$this->path = $operation->path;
$this->value = property_exists($operation, 'value') ? $operation->value : null;
}