1 | <?php |
||
31 | class Stanza extends XmlElement |
||
32 | { |
||
33 | private $_from = false; |
||
34 | private $_to = false; |
||
35 | |||
36 | /** |
||
37 | * Stanza constructor. |
||
38 | * @param string $kind Stanza kind. According to XMPP RFC, one of "iq", "message", "presence" |
||
39 | * @param array $options { |
||
40 | * @var Jid $from Jid representing "from" stanza attribute |
||
41 | * @var Jid $to Jid representing "to" stanza attribute |
||
42 | * @var string $id Unique id, will be generated if omitted |
||
43 | * @var string $type Stanza type |
||
44 | * } |
||
45 | * @param mixed $content Content to append |
||
46 | */ |
||
47 | public function __construct(string $kind, array $options = [], $content = null) |
||
54 | |||
55 | public function getFrom() |
||
63 | |||
64 | public function getTo() |
||
72 | |||
73 | public function getType() |
||
77 | |||
78 | public function getId() |
||
82 | |||
83 | public function setFrom($from) |
||
91 | |||
92 | public function setTo($to) |
||
100 | |||
101 | public function setType(string $type) |
||
105 | |||
106 | public function setId(string $id) |
||
110 | |||
111 | public function regenerateId(string $prefix = null) |
||
115 | |||
116 | public function response() |
||
126 | |||
127 | /** |
||
128 | * Initializes element with given name and URI |
||
129 | * |
||
130 | * @param string $name Element name, including prefix if needed |
||
131 | * @param string $uri Namespace URI of element |
||
132 | */ |
||
133 | protected function init(string $name, string $uri = null) |
||
138 | |||
139 | |||
140 | } |
||
141 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: