1 | <?php |
||
24 | class Input implements ModelInterface |
||
25 | { |
||
26 | const TYPE_TEXT = 'text'; |
||
27 | const TYPE_PASSWORD = 'password'; |
||
28 | const TYPE_HIDDEN = 'hidden'; |
||
29 | const TYPE_RADIO = 'radio'; |
||
30 | const TYPE_CHECKBOX = 'checkbox'; |
||
31 | |||
32 | const DATATYPE_INT = 'int'; |
||
33 | const DATATYPE_STRING = 'string'; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | private $sName; |
||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | private $sValue; |
||
43 | /** |
||
44 | * @var string |
||
45 | */ |
||
46 | private $sType; |
||
47 | /** |
||
48 | * @var string |
||
49 | */ |
||
50 | private $sDataType; |
||
51 | /** |
||
52 | * @var integer |
||
53 | */ |
||
54 | private $iMaxLength; |
||
55 | /** |
||
56 | * @var \mrcnpdlk\Grandstream\XMLApp\Application\Model\Styles |
||
57 | */ |
||
58 | private $oStyles; |
||
59 | /** |
||
60 | * Only for Radio |
||
61 | * |
||
62 | * @var string |
||
63 | */ |
||
64 | private $sGroupName; |
||
65 | /** |
||
66 | * Only for Radio |
||
67 | * |
||
68 | * @var boolean |
||
69 | */ |
||
70 | private $isSelected; |
||
71 | /** |
||
72 | * Only for Radio & CheckBox |
||
73 | * |
||
74 | * @var string |
||
75 | */ |
||
76 | private $sLabel; |
||
77 | |||
78 | /** |
||
79 | * Input constructor. |
||
80 | * |
||
81 | * @param string $sName |
||
82 | * @param string|null $sValue |
||
83 | * @param string $sType |
||
84 | */ |
||
85 | public function __construct(string $sName, string $sValue = null, string $sType = Input::TYPE_TEXT) |
||
92 | |||
93 | /** |
||
94 | * @param string $sDataType |
||
95 | * |
||
96 | * @return \mrcnpdlk\Grandstream\XMLApp\Application\Model\Input |
||
97 | */ |
||
98 | public function setDataType(string $sDataType = Input::DATATYPE_STRING) |
||
104 | |||
105 | /** |
||
106 | * @param int $iMaxLength |
||
107 | * |
||
108 | * @return \mrcnpdlk\Grandstream\XMLApp\Application\Model\Input |
||
109 | */ |
||
110 | public function setMaxLength(int $iMaxLength) |
||
116 | |||
117 | /** |
||
118 | * @param \mrcnpdlk\Grandstream\XMLApp\Application\Model\Styles $oStyles |
||
119 | * |
||
120 | * @return \mrcnpdlk\Grandstream\XMLApp\Application\Model\Input |
||
121 | */ |
||
122 | public function setStyles(Styles $oStyles) |
||
128 | |||
129 | /** |
||
130 | * @param string $sGroupName |
||
131 | * |
||
132 | * @return \mrcnpdlk\Grandstream\XMLApp\Application\Model\Input |
||
133 | */ |
||
134 | public function setGroupName(string $sGroupName) |
||
140 | |||
141 | /** |
||
142 | * @param string $sLabel |
||
143 | * |
||
144 | * @return \mrcnpdlk\Grandstream\XMLApp\Application\Model\Input |
||
145 | */ |
||
146 | public function setLabel(string $sLabel) |
||
153 | |||
154 | /** |
||
155 | * @param bool $isSelected |
||
156 | * |
||
157 | * @return \mrcnpdlk\Grandstream\XMLApp\Application\Model\Input |
||
158 | */ |
||
159 | public function setSelected(bool $isSelected = true) |
||
165 | |||
166 | /** |
||
167 | * @return \mrcnpdlk\Grandstream\XMLApp\MyXML |
||
168 | */ |
||
169 | public function getXml(): MyXML |
||
182 | } |
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: