Skip to content

Commit

Permalink
Merge pull request #109 from halaxa/exception-annotations
Browse files Browse the repository at this point in the history
Missing PHP-Doc PathNotFoundException
  • Loading branch information
halaxa committed Nov 26, 2023
2 parents 8d583e9 + 8a6178d commit 401766d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/FileChunks.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public function __construct($fileName, $chunkSize = 1024 * 8)

/**
* @return \Generator
*
* @throws Exception\InvalidArgumentException
*/
#[\ReturnTypeWillChange]
public function getIterator()
Expand Down
11 changes: 11 additions & 0 deletions src/Items.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,18 @@ public static function fromIterable($iterable, array $options = [])

/**
* @return \Generator
*
* @throws Exception\PathNotFoundException
*/
#[\ReturnTypeWillChange]
public function getIterator()
{
return $this->parser->getIterator();
}

/**
* @throws Exception\JsonMachineException
*/
public function getPosition()
{
return $this->parser->getPosition();
Expand All @@ -134,11 +139,17 @@ public function getJsonPointers(): array
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();
Expand Down
3 changes: 3 additions & 0 deletions src/ItemsOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ class ItemsOptions extends \ArrayObject
{
private $options = [];

/**
* @throws InvalidArgumentException
*/
public function __construct(array $options = [])
{
$this->validateOptions($options);
Expand Down
6 changes: 6 additions & 0 deletions src/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@ public function getJsonPointers(): array
return array_values($this->jsonPointers);
}

/**
* @throws JsonMachineException
*/
public function getCurrentJsonPointer(): string
{
if ($this->currentPath === null) {
Expand All @@ -330,6 +333,9 @@ public function getCurrentJsonPointer(): string
return self::pathToJsonPointer($this->currentPath);
}

/**
* @throws JsonMachineException
*/
public function getMatchedJsonPointer(): string
{
if ($this->matchedJsonPointer === null) {
Expand Down
2 changes: 2 additions & 0 deletions src/StreamChunks.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class StreamChunks implements \IteratorAggregate
/**
* @param resource $stream
* @param int $chunkSize
*
* @throws InvalidArgumentException
*/
public function __construct($stream, $chunkSize = 1024 * 8)
{
Expand Down

0 comments on commit 401766d

Please sign in to comment.