1 | <?php |
||
9 | class Converter |
||
10 | { |
||
11 | /** @var string */ |
||
12 | protected $pathToPhp7Code; |
||
13 | |||
14 | /** |
||
15 | * @param string $pathToPhp7Code |
||
16 | * |
||
17 | * @throws \Spatie\Php7to5\Exceptions\InvalidParameter |
||
18 | */ |
||
19 | public function __construct($pathToPhp7Code) |
||
27 | |||
28 | /** |
||
29 | * @param string $destination |
||
30 | */ |
||
31 | public function saveAsPhp5($destination) |
||
35 | |||
36 | /** |
||
37 | * @return string |
||
38 | */ |
||
39 | public function getPhp5Code() |
||
55 | |||
56 | /** |
||
57 | * @return \PhpParser\NodeTraverser |
||
58 | */ |
||
59 | public static function getTraverser() |
||
73 | } |
||
74 |
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.