1 | <?php |
||
10 | class TwigResponder implements ResponderInterface |
||
11 | { |
||
12 | |||
13 | 1 | use ResponseFactoryTrait; |
|
14 | |||
15 | /** |
||
16 | * @var TwigEnvironment |
||
17 | */ |
||
18 | public $twig; |
||
19 | |||
20 | |||
21 | /** |
||
22 | * @var strinfg |
||
23 | */ |
||
24 | public $template_field = "template"; |
||
25 | |||
26 | |||
27 | /** |
||
28 | * @var array |
||
29 | */ |
||
30 | public $default_context = array(); |
||
31 | |||
32 | |||
33 | /** |
||
34 | * @var string|bool |
||
35 | */ |
||
36 | public $default_template = false; |
||
37 | |||
38 | |||
39 | |||
40 | /** |
||
41 | * @param TwigEnvironment $twig Twig environment |
||
42 | * @param string $template_field Array field taht will contain template |
||
43 | * @param array $default_context Default template context |
||
44 | * @param ResponseFactoryInterface|null $response_factory Optional: PSR-17 Response Factory |
||
45 | */ |
||
46 | 2 | public function __construct( TwigEnvironment $twig, string $template_field, array $default_context = array(), ResponseFactoryInterface $response_factory = null ) |
|
53 | |||
54 | |||
55 | |||
56 | /** |
||
57 | * @param TwigEnvironment $twig |
||
58 | */ |
||
59 | 6 | public function setTwig(TwigEnvironment $twig ) |
|
64 | |||
65 | |||
66 | /** |
||
67 | * @return mixed |
||
68 | */ |
||
69 | public function getDefaultTemplate( ) |
||
73 | |||
74 | |||
75 | /** |
||
76 | * @param mixed $default_template |
||
77 | */ |
||
78 | public function setDefaultTemplate( $default_template ) |
||
83 | |||
84 | |||
85 | |||
86 | /** |
||
87 | * @param array $default_context |
||
88 | */ |
||
89 | 6 | public function setDefaultContext( array $default_context ) |
|
94 | |||
95 | |||
96 | /** |
||
97 | * @param string $field |
||
98 | */ |
||
99 | 2 | public function setTemplateField( string $field ) |
|
104 | |||
105 | |||
106 | |||
107 | |||
108 | /** |
||
109 | * @inheritDoc |
||
110 | */ |
||
111 | public function __invoke( $context ) : ResponseInterface |
||
115 | |||
116 | |||
117 | /** |
||
118 | * @inheritDoc |
||
119 | * @param array|ArrayObject Context |
||
120 | * |
||
121 | * @throws ResponderInvalidArgumentException |
||
122 | * @throws ResponderRuntimeException |
||
123 | */ |
||
124 | 8 | public function createResponse( $context ) : ResponseInterface |
|
159 | } |
||
160 |
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..