Skip to content

Improve type hints on Exception properties #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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