mirror of
https://github.com/cerbero90/json-parser.git
synced 2025-01-17 21:18:41 +01:00
Support any JSON source by default
This commit is contained in:
parent
1ec7b9af1b
commit
a26ebd8ae8
@ -5,7 +5,7 @@ namespace Cerbero\JsonParser;
|
||||
use Cerbero\JsonParser\Decoders\Decoder;
|
||||
use Cerbero\JsonParser\Decoders\ObjectDecoder;
|
||||
use Cerbero\JsonParser\Pointers\Pointer;
|
||||
use Cerbero\JsonParser\Sources\Source;
|
||||
use Cerbero\JsonParser\Sources\AnySource;
|
||||
use IteratorAggregate;
|
||||
use Traversable;
|
||||
|
||||
@ -37,7 +37,8 @@ class JsonParser implements IteratorAggregate
|
||||
public function __construct(mixed $source)
|
||||
{
|
||||
$this->config = new Config();
|
||||
$this->parser = new Parser(new Lexer(new Source($source)), $this->config);
|
||||
$source = new AnySource($source, $this->config);
|
||||
$this->parser = new Parser(new Lexer($source), $this->config);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user