Skip to content

Commit d5716c1

Browse files
AHN-131: Fix Failing Psalm Static Analysis in php-billing Composer Package Build
1 parent ab843be commit d5716c1

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/Exception/ActionChargingException.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
namespace hiqdev\php\billing\Exception;
55

6+
use hidev\exception\HasContext;
7+
use hidev\exception\HasContextInterface;
68
use hiqdev\php\billing\action\ActionInterface;
79
use Throwable;
810

@@ -12,9 +14,9 @@
1214
*
1315
* @author Dmytro Naumenko <[email protected]>
1416
*/
15-
final class ActionChargingException extends RuntimeException
17+
final class ActionChargingException extends RuntimeException implements HasContextInterface
1618
{
17-
private readonly ActionInterface $action;
19+
use HasContext;
1820

1921
public static function forAction(ActionInterface $action, Throwable $previousException): self
2022
{
@@ -32,13 +34,8 @@ public static function forAction(ActionInterface $action, Throwable $previousExc
3234
}
3335

3436
$self = new self($message, 0, $previousException);
35-
$self->action = $action;
37+
$self->addContext(['action' => $action]);
3638

3739
return $self;
3840
}
39-
40-
public function getAction(): ActionInterface
41-
{
42-
return $this->action;
43-
}
4441
}

0 commit comments

Comments
 (0)