Skip to content

Commit

Permalink
Merge pull request #59 from wmde/master
Browse files Browse the repository at this point in the history
Improve type hints on Exception properties
  • Loading branch information
vearutop authored Oct 24, 2022
2 parents 807bf7d + 8eec4c5 commit 9aaac36
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
7 changes: 4 additions & 3 deletions src/MissingFieldException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@

namespace Swaggest\JsonDiff;

use Swaggest\JsonDiff\JsonPatch\OpPath;
use Throwable;

class MissingFieldException extends Exception
{
/** @var string */
private $missingField;
/** @var object */
/** @var OpPath|object */
private $operation;

/**
* @param string $missingField
* @param object $operation
* @param OpPath|object $operation
* @param int $code
* @param Throwable|null $previous
*/
Expand All @@ -38,7 +39,7 @@ public function getMissingField()
}

/**
* @return object
* @return OpPath|object
*/
public function getOperation()
{
Expand Down
13 changes: 7 additions & 6 deletions src/PatchTestOperationFailedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
namespace Swaggest\JsonDiff;


use Swaggest\JsonDiff\JsonPatch\Test;
use Throwable;

class PatchTestOperationFailedException extends Exception
{
/** @var object */
/** @var Test */
private $operation;
/** @var string */
/** @var mixed */
private $actualValue;

/**
* @param object $operation
* @param string $actualValue
* @param Test $operation
* @param mixed $actualValue
* @param int $code
* @param Throwable|null $previous
*/
Expand All @@ -32,15 +33,15 @@ public function __construct(
}

/**
* @return object
* @return Test
*/
public function getOperation()
{
return $this->operation;
}

/**
* @return string
* @return mixed
*/
public function getActualValue()
{
Expand Down
7 changes: 4 additions & 3 deletions src/PathException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@
namespace Swaggest\JsonDiff;


use Swaggest\JsonDiff\JsonPatch\OpPath;
use Throwable;

class PathException extends Exception
{
/** @var object */
/** @var OpPath */
private $operation;

/** @var string */
private $field;

/**
* @param string $message
* @param object $operation
* @param OpPath $operation
* @param string $field
* @param int $code
* @param Throwable|null $previous
Expand All @@ -34,7 +35,7 @@ public function __construct(
}

/**
* @return object
* @return OpPath
*/
public function getOperation()
{
Expand Down
7 changes: 4 additions & 3 deletions src/UnknownOperationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
namespace Swaggest\JsonDiff;


use Swaggest\JsonDiff\JsonPatch\OpPath;
use Throwable;

class UnknownOperationException extends Exception
{
/** @var object */
/** @var OpPath|object */
private $operation;

/**
* @param object $operation
* @param OpPath|object $operation
* @param int $code
* @param Throwable|null $previous
*/
Expand All @@ -27,7 +28,7 @@ public function __construct(
}

/**
* @return object
* @return OpPath|object
*/
public function getOperation()
{
Expand Down

0 comments on commit 9aaac36

Please sign in to comment.