Skip to content

Commit 8eec4c5

Browse files
Silvan-WMDEjakobw
authored andcommitted
Improve type hints on Exception properties
1 parent 478e618 commit 8eec4c5

4 files changed

+19
-15
lines changed

src/MissingFieldException.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22

33
namespace Swaggest\JsonDiff;
44

5+
use Swaggest\JsonDiff\JsonPatch\OpPath;
56
use Throwable;
67

78
class MissingFieldException extends Exception
89
{
910
/** @var string */
1011
private $missingField;
11-
/** @var object */
12+
/** @var OpPath|object */
1213
private $operation;
1314

1415
/**
1516
* @param string $missingField
16-
* @param object $operation
17+
* @param OpPath|object $operation
1718
* @param int $code
1819
* @param Throwable|null $previous
1920
*/
@@ -38,7 +39,7 @@ public function getMissingField()
3839
}
3940

4041
/**
41-
* @return object
42+
* @return OpPath|object
4243
*/
4344
public function getOperation()
4445
{

src/PatchTestOperationFailedException.php

+7-6
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@
33
namespace Swaggest\JsonDiff;
44

55

6+
use Swaggest\JsonDiff\JsonPatch\Test;
67
use Throwable;
78

89
class PatchTestOperationFailedException extends Exception
910
{
10-
/** @var object */
11+
/** @var Test */
1112
private $operation;
12-
/** @var string */
13+
/** @var mixed */
1314
private $actualValue;
1415

1516
/**
16-
* @param object $operation
17-
* @param string $actualValue
17+
* @param Test $operation
18+
* @param mixed $actualValue
1819
* @param int $code
1920
* @param Throwable|null $previous
2021
*/
@@ -32,15 +33,15 @@ public function __construct(
3233
}
3334

3435
/**
35-
* @return object
36+
* @return Test
3637
*/
3738
public function getOperation()
3839
{
3940
return $this->operation;
4041
}
4142

4243
/**
43-
* @return string
44+
* @return mixed
4445
*/
4546
public function getActualValue()
4647
{

src/PathException.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@
33
namespace Swaggest\JsonDiff;
44

55

6+
use Swaggest\JsonDiff\JsonPatch\OpPath;
67
use Throwable;
78

89
class PathException extends Exception
910
{
10-
/** @var object */
11+
/** @var OpPath */
1112
private $operation;
1213

1314
/** @var string */
1415
private $field;
1516

1617
/**
1718
* @param string $message
18-
* @param object $operation
19+
* @param OpPath $operation
1920
* @param string $field
2021
* @param int $code
2122
* @param Throwable|null $previous
@@ -34,7 +35,7 @@ public function __construct(
3435
}
3536

3637
/**
37-
* @return object
38+
* @return OpPath
3839
*/
3940
public function getOperation()
4041
{

src/UnknownOperationException.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
namespace Swaggest\JsonDiff;
44

55

6+
use Swaggest\JsonDiff\JsonPatch\OpPath;
67
use Throwable;
78

89
class UnknownOperationException extends Exception
910
{
10-
/** @var object */
11+
/** @var OpPath|object */
1112
private $operation;
1213

1314
/**
14-
* @param object $operation
15+
* @param OpPath|object $operation
1516
* @param int $code
1617
* @param Throwable|null $previous
1718
*/
@@ -27,7 +28,7 @@ public function __construct(
2728
}
2829

2930
/**
30-
* @return object
31+
* @return OpPath|object
3132
*/
3233
public function getOperation()
3334
{

0 commit comments

Comments
 (0)