mirror of
https://github.com/cerbero90/json-parser.git
synced 2025-01-17 13:08:16 +01:00
Define a global lazy pointer when cloning the config
This commit is contained in:
parent
4212f20149
commit
f930423627
@ -8,6 +8,7 @@ use Cerbero\JsonParser\Decoders\Decoder;
|
||||
use Cerbero\JsonParser\Decoders\SimdjsonDecoder;
|
||||
use Cerbero\JsonParser\Exceptions\DecodingException;
|
||||
use Cerbero\JsonParser\Exceptions\SyntaxException;
|
||||
use Cerbero\JsonParser\Pointers\Pointer;
|
||||
use Cerbero\JsonParser\Pointers\Pointers;
|
||||
use Closure;
|
||||
|
||||
@ -63,4 +64,15 @@ final class Config
|
||||
$this->onDecodingError = fn (DecodedValue $decoded) => throw new DecodingException($decoded);
|
||||
$this->onSyntaxError = fn (SyntaxException $e) => throw $e;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clone the configuration
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __clone(): void
|
||||
{
|
||||
$this->pointers = new Pointers();
|
||||
$this->pointers->add(new Pointer('', true));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user