1
0
mirror of https://github.com/halaxa/json-machine.git synced 2025-01-29 10:28:09 +01:00

Added missing @throws annotations

This commit is contained in:
Filip Halaxa 2023-11-18 17:27:39 +01:00
parent 68f51511fc
commit a7091c7050
5 changed files with 22 additions and 1 deletions

View File

@ -24,6 +24,7 @@ class FileChunks implements \IteratorAggregate
/**
* @return \Generator
* @throws Exception\InvalidArgumentException
*/
#[\ReturnTypeWillChange]
public function getIterator()

View File

@ -117,6 +117,7 @@ final class Items implements \IteratorAggregate, PositionAware
/**
* @return \Generator
* @throws Exception\PathNotFoundException
*/
#[\ReturnTypeWillChange]
public function getIterator()
@ -124,6 +125,9 @@ final class Items implements \IteratorAggregate, PositionAware
return $this->parser->getIterator();
}
/**
* @throws Exception\JsonMachineException
*/
public function getPosition()
{
return $this->parser->getPosition();
@ -134,11 +138,17 @@ final class Items implements \IteratorAggregate, PositionAware
return $this->parser->getJsonPointers();
}
/**
* @throws Exception\JsonMachineException
*/
public function getCurrentJsonPointer(): string
{
return $this->parser->getCurrentJsonPointer();
}
/**
* @throws Exception\JsonMachineException
*/
public function getMatchedJsonPointer(): string
{
return $this->parser->getMatchedJsonPointer();

View File

@ -12,6 +12,9 @@ class ItemsOptions extends \ArrayObject
{
private $options = [];
/**
* @throws InvalidArgumentException
*/
public function __construct(array $options = [])
{
$this->validateOptions($options);

View File

@ -321,6 +321,9 @@ class Parser implements \IteratorAggregate, PositionAware
return array_values($this->jsonPointers);
}
/**
* @throws JsonMachineException
*/
public function getCurrentJsonPointer(): string
{
if ($this->currentPath === null) {
@ -330,6 +333,9 @@ class Parser implements \IteratorAggregate, PositionAware
return self::pathToJsonPointer($this->currentPath);
}
/**
* @throws JsonMachineException
*/
public function getMatchedJsonPointer(): string
{
if ($this->matchedJsonPointer === null) {

View File

@ -16,7 +16,8 @@ class StreamChunks implements \IteratorAggregate
/**
* @param resource $stream
* @param int $chunkSize
* @param int $chunkSize
* @throws InvalidArgumentException
*/
public function __construct($stream, $chunkSize = 1024 * 8)
{