1 | <?php |
||
18 | abstract class AbstractHtml implements HtmlInterface |
||
19 | { |
||
20 | use EscaperAwareTrait; |
||
21 | use FormatTrait; |
||
22 | |||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | private $value; |
||
27 | |||
28 | /** |
||
29 | * @var array |
||
30 | */ |
||
31 | private $attribs = []; |
||
32 | |||
33 | /** |
||
34 | * @return string |
||
35 | */ |
||
36 | abstract protected function getTagName(); |
||
37 | |||
38 | /** |
||
39 | * @param string|array|object $value New value;current value placeholder is `%s` |
||
40 | * @return $this |
||
41 | */ |
||
42 | public function setValue($value) |
||
47 | |||
48 | /** |
||
49 | * @param string $name |
||
50 | * @param string $value |
||
51 | * @return $this |
||
52 | */ |
||
53 | protected function setAttribute($name, $value) |
||
58 | |||
59 | /** |
||
60 | * @param $title |
||
61 | * @return $this |
||
62 | */ |
||
63 | public function setTitle($title) |
||
68 | |||
69 | /** |
||
70 | * @param string $class |
||
71 | * @return $this |
||
72 | */ |
||
73 | public function setClass($class) |
||
78 | |||
79 | /** |
||
80 | * @param array|string $style |
||
81 | * @param string|null $value |
||
82 | * @return $this |
||
83 | */ |
||
84 | public function setStyle($style, $value = null) |
||
117 | |||
118 | /** |
||
119 | * @param string|array|HtmlInterface $value |
||
120 | * @return string |
||
121 | */ |
||
122 | private function normalizeValue($value) |
||
138 | |||
139 | /** |
||
140 | * @param string $tag |
||
141 | * @param string $attribs |
||
142 | * @param string $value |
||
143 | * @return string |
||
144 | */ |
||
145 | protected function toStringInternal($tag, $attribs, $value) |
||
149 | |||
150 | /** |
||
151 | * @return string |
||
152 | */ |
||
153 | public function __toString() |
||
171 | } |
||
172 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.