Skip to content

Commit

Permalink
Fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
cerbero90 committed Jun 22, 2023
1 parent 47a419a commit cbb672d
Show file tree
Hide file tree
Showing 13 changed files with 12 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/Concerns/DetectsEndpoints.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Cerbero\JsonParser\Concerns;

use function is_array;
use function in_array;
use function is_array;

/**
* The trait to detect endpoints.
Expand Down
2 changes: 1 addition & 1 deletion src/Concerns/GuzzleAware.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use Cerbero\JsonParser\Exceptions\GuzzleRequiredException;
use GuzzleHttp\Client;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\UriInterface;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/IntersectingPointersException.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ class IntersectingPointersException extends Exception implements JsonParserExcep
*/
public function __construct(public readonly Pointer $pointer1, public readonly Pointer $pointer2)
{
parent::__construct("The pointers [$pointer1] and [$pointer2] are intersecting");
parent::__construct("The pointers [{$pointer1}] and [{$pointer2}] are intersecting");
}
}
2 changes: 1 addition & 1 deletion src/Exceptions/InvalidPointerException.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ final class InvalidPointerException extends Exception implements JsonParserExcep
*/
public function __construct(public readonly string $pointer)
{
parent::__construct("The string [$pointer] is not a valid JSON pointer");
parent::__construct("The string [{$pointer}] is not a valid JSON pointer");
}
}
2 changes: 1 addition & 1 deletion src/Exceptions/NodeNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ class NodeNotFoundException extends Exception implements JsonParserException
*/
public function __construct(public mixed $node)
{
parent::__construct("The node [$node] was not found");
parent::__construct("The node [{$node}] was not found");
}
}
2 changes: 1 addition & 1 deletion src/Exceptions/SyntaxException.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class SyntaxException extends Exception implements JsonParserException
*/
public function __construct(public readonly string $value)
{
parent::__construct("Syntax error: unexpected '$value'");
parent::__construct("Syntax error: unexpected '{$value}'");
}

/**
Expand Down
6 changes: 1 addition & 5 deletions src/Pointers/Pointer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
use Closure;
use Stringable;

use function array_slice;
use function count;
use function is_int;
use function array_slice;

/**
* The JSON pointer.
Expand Down Expand Up @@ -123,13 +123,9 @@ public function matchesTree(Tree $tree): bool
*/
public function includesTree(Tree $tree): bool
{
<<<<<<< HEAD
$originalTree = $tree->original();

if ($this->pointer == '' || end($this->referenceTokens) == end($originalTree)) {
=======
if ($this->pointer == '') {
>>>>>>> develop
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Sources/IterableSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use Traversable;

use function is_array;
use function count;
use function is_array;

/**
* The iterable source.
Expand Down
2 changes: 1 addition & 1 deletion src/Sources/JsonResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use Traversable;

use function is_string;
use function is_resource;
use function is_string;

/**
* The resource source.
Expand Down
3 changes: 0 additions & 3 deletions src/Tokens/Lexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

use Cerbero\JsonParser\Exceptions\SyntaxException;
use Cerbero\JsonParser\Sources\Source;
use Cerbero\JsonParser\Tokens\Token;
use Cerbero\JsonParser\Tokens\Tokenizer;
use Cerbero\JsonParser\Tokens\Tokens;
use Cerbero\JsonParser\ValueObjects\Progress;
use IteratorAggregate;
use Traversable;
Expand Down
2 changes: 1 addition & 1 deletion src/Tokens/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function current(): mixed
return null;
}

$this->key = $this->decoder->decode($state->tree->currentKey());
$this->key = $this->decoder->decode($this->state->tree->currentKey());
$value = $this->decoder->decode($this->state->value());

if ($value instanceof self) {
Expand Down
2 changes: 1 addition & 1 deletion src/ValueObjects/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Cerbero\JsonParser\ValueObjects;

use Cerbero\JsonParser\Decoders\JsonDecoder;
use Cerbero\JsonParser\Decoders\DecodedValue;
use Cerbero\JsonParser\Decoders\Decoder;
use Cerbero\JsonParser\Decoders\JsonDecoder;
use Cerbero\JsonParser\Decoders\SimdjsonDecoder;
use Cerbero\JsonParser\Exceptions\DecodingException;
use Cerbero\JsonParser\Exceptions\SyntaxException;
Expand Down
2 changes: 1 addition & 1 deletion src/ValueObjects/Tree.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public function isDeep(): bool
$pointer = $this->pointers->matching();

return $pointer == '' ? false : $this->depth >= $pointer->depth;
return $pointer == '' ? $this->depth > 0 : $this->depth >= $pointer->depth;
// return $pointer == '' ? $this->depth > 0 : $this->depth >= $pointer->depth;
}

/**
Expand Down

0 comments on commit cbb672d

Please sign in to comment.