| 1 | <?php |
||
| 19 | class ArrayPrinter |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @var Parser |
||
| 23 | */ |
||
| 24 | private $parser; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var PrettyPrinterAbstract |
||
| 28 | */ |
||
| 29 | private $printer; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Constructor |
||
| 33 | * |
||
| 34 | * @param Parser $parser |
||
| 35 | * @param PrettyPrinterAbstract $printer |
||
| 36 | */ |
||
| 37 | public function __construct(Parser $parser = null, PrettyPrinterAbstract $printer = null) |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Take a PHP array and convert it to a string |
||
| 53 | * |
||
| 54 | * @param array $array |
||
| 55 | * @return string |
||
| 56 | */ |
||
| 57 | public function printArray(array $array) |
||
| 66 | } |
||
| 67 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.