| 1 | <?php |
||
| 11 | trait ResponseAwareTrait |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var Response|null |
||
| 15 | */ |
||
| 16 | protected $response = null; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var boolean |
||
| 20 | */ |
||
| 21 | protected $autoInitResponse = false; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Get the container. |
||
| 25 | * |
||
| 26 | * @param bool $autoInit |
||
| 27 | * @return Response |
||
| 28 | */ |
||
| 29 | 1 | public function getResponse($autoInit = null) |
|
| 30 | { |
||
| 31 | 1 | if (is_bool($autoInit)) { |
|
| 32 | 1 | $this->setAutoInitResponse($autoInit); |
|
| 33 | } |
||
| 34 | 1 | if ($this->response == null && $this->isAutoInitResponse()) { |
|
| 35 | 1 | $this->initResponse(); |
|
| 36 | } |
||
| 37 | |||
| 38 | 1 | return $this->response; |
|
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Set a container. |
||
| 43 | * |
||
| 44 | * @param Response|ResponseInterface $response |
||
| 45 | * @return $this |
||
| 46 | */ |
||
| 47 | public function setResponse(ResponseInterface $response) |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @return bool |
||
| 56 | */ |
||
| 57 | 1 | public function hasResponse() |
|
| 61 | |||
| 62 | /** |
||
| 63 | * @return bool |
||
| 64 | */ |
||
| 65 | 1 | public function isAutoInitResponse(): bool |
|
| 69 | |||
| 70 | /** |
||
| 71 | * @param bool $autoInitResponse |
||
| 72 | */ |
||
| 73 | 1 | public function setAutoInitResponse(bool $autoInitResponse) |
|
| 77 | |||
| 78 | 1 | public function initResponse() |
|
| 82 | |||
| 83 | /** |
||
| 84 | * @return Response |
||
| 85 | */ |
||
| 86 | 1 | public function newResponse() |
|
| 90 | } |
||
| 91 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..