Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
75.00% covered (warning)
75.00%
3 / 4
66.67% covered (warning)
66.67%
2 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
SerializationException
75.00% covered (warning)
75.00%
3 / 4
66.67% covered (warning)
66.67%
2 / 3
4.25
0.00% covered (danger)
0.00%
0 / 1
 __construct
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
2
 setResponse
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getResponse
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace Fingerprint\ServerAPI;
4
5use Psr\Http\Message\ResponseInterface;
6
7final class SerializationException extends \Exception
8{
9    protected ?ResponseInterface $response;
10
11    public function __construct(?ResponseInterface $response = null, ?\Exception $prev = null)
12    {
13        parent::__construct("Response from the server couldn't be serialized", $prev ? $prev->getCode() : 0, $prev);
14        $this->response = $response;
15    }
16
17    public function setResponse(ResponseInterface $response): void
18    {
19        $this->response = $response;
20    }
21
22    public function getResponse(): ?ResponseInterface
23    {
24        return $this->response;
25    }
26}