bearsunday /
BEAR.QueryRepository
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace BEAR\QueryRepository; |
||
| 6 | |||
| 7 | use BEAR\Resource\AbstractUri; |
||
| 8 | use BEAR\Resource\ResourceObject; |
||
| 9 | |||
| 10 | /** @psalm-suppress MissingConstructor */ |
||
| 11 | final class ResourceState |
||
| 12 | { |
||
| 13 | /** @var int */ |
||
| 14 | public $code = 200; |
||
| 15 | |||
| 16 | /** @var AbstractUri */ |
||
| 17 | public $uri; |
||
| 18 | |||
| 19 | /** @var array<string, string> */ |
||
| 20 | public $headers = []; |
||
| 21 | |||
| 22 | /** @var mixed */ |
||
| 23 | public $body; |
||
| 24 | |||
| 25 | /** @var ?string */ |
||
| 26 | public $view; |
||
| 27 | |||
| 28 | public static function create(ResourceObject $ro, mixed $body, string|null $view): self |
||
| 29 | { |
||
| 30 | $state = new self(); |
||
| 31 | $state->code = $ro->code; |
||
| 32 | $state->uri = $ro->uri; |
||
| 33 | $state->headers = $ro->headers; |
||
|
0 ignored issues
–
show
|
|||
| 34 | $state->view = $view; |
||
| 35 | $state->body = $body; |
||
| 36 | |||
| 37 | return $state; |
||
| 38 | } |
||
| 39 | |||
| 40 | public function visit(ResourceObject $ro): void |
||
| 41 | { |
||
| 42 | $ro->uri = $this->uri; |
||
| 43 | $ro->code = $this->code; |
||
| 44 | $ro->headers = $this->headers; |
||
|
0 ignored issues
–
show
It seems like
$this->headers of type array<string,string> is incompatible with the declared type BEAR\Resource\Headers of property $headers.
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.. Loading history...
|
|||
| 45 | $ro->body = $this->body; |
||
| 46 | $ro->view = $this->view; |
||
| 47 | } |
||
| 48 | } |
||
| 49 |
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..