| 1 | <?php |
||
| 16 | class Writer { |
||
| 17 | |||
| 18 | public $indent = "\t"; |
||
| 19 | public $newLine = "\r\n"; |
||
| 20 | |||
| 21 | 1 | public function __construct( $options = [] ) |
|
| 22 | { |
||
| 23 | 1 | $optionList = ['indent','newLine']; |
|
| 24 | 1 | foreach( $options as $option => $optionValue ) { |
|
| 25 | if ( in_array( $option, $optionList ) ) { |
||
| 26 | $this->{$option} = $optionValue; |
||
| 27 | } |
||
| 28 | } |
||
| 29 | 1 | } |
|
| 30 | |||
| 31 | 1 | public function __call( $name, $args ) |
|
| 35 | |||
| 36 | } |
||
| 37 | |||
| 38 |
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: