| 1 | <?php |
||
| 14 | abstract class ValueElement extends Element { |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var string holds the element's value |
||
| 18 | */ |
||
| 19 | protected $value = ''; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @param string $type |
||
| 23 | * @param array|string $value |
||
| 24 | * @param array $attributes |
||
| 25 | */ |
||
| 26 | public function __construct($type, $value, $attributes = array()) { |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Get or set the element's value |
||
| 33 | * |
||
| 34 | * @param null|string $value |
||
| 35 | * @return string|$this |
||
| 36 | */ |
||
| 37 | public function val($value = null) { |
||
| 44 | |||
| 45 | } |
||
| 46 |
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.