for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* Copyright (c) Nate Brunette.
* Distributed under the MIT License (http://opensource.org/licenses/MIT)
*/
declare(strict_types=1);
namespace Tebru\Gson\Internal;
use Tebru\Gson\Exclusion\DeserializationExclusionData;
use Tebru\Gson\ReaderContext;
/**
* Class DefaultDeserializationExclusionData
*
* @author Nate Brunette <[email protected]>
class DefaultDeserializationExclusionData implements DeserializationExclusionData
{
* @var mixed
private $payload;
* @var object
private $objectToReadInto;
* @var ReaderContext
private $context;
* @var callable
private $path;
* Constructor
* @param mixed $payload
* @param object $objectToReadInto
* @param ReaderContext $context
* @param callable $path
public function __construct($payload, $objectToReadInto, ReaderContext $context, callable $path)
$this->payload = $payload;
$this->objectToReadInto = $objectToReadInto;
$this->context = $context;
$this->path = $path;
}
* Get the json data after json_decode()
* @return mixed
public function getPayload()
return $this->payload;
* Returns the initial object if it was provided to Gson::fromJson() or null
* @return object|null
public function getObjectToReadInto()
return $this->objectToReadInto;
* Get the reader context
* @return ReaderContext
public function getContext(): ReaderContext
return $this->context;
* Get the current path formatted as json xpath
* @return string
public function getPath(): string
$path = $this->path;
return $path();