1 | <?php |
||
7 | abstract class WriterAbstract |
||
8 | { |
||
9 | /** |
||
10 | * @var string |
||
11 | */ |
||
12 | private $indent = ' '; |
||
13 | |||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private $linebreak = "\n"; |
||
18 | |||
19 | /** |
||
20 | * @param string $indent |
||
21 | */ |
||
22 | 10 | protected function setIndent($indent = ' ') |
|
26 | |||
27 | /** |
||
28 | * @param string $string |
||
29 | * @return string |
||
30 | */ |
||
31 | 10 | public function formatLine($string) |
|
35 | |||
36 | /** |
||
37 | * @param \TokenReflection\IReflectionClass $declaringClass The class using the namespace aliases |
||
38 | * @param string $aliasedClassName The class name used in the declaring class |
||
39 | * @return string |
||
40 | */ |
||
41 | 3 | protected function expandNamespaceAlias(IReflectionClass $declaringClass, $aliasedClassName) |
|
52 | |||
53 | /** |
||
54 | * @param string $className |
||
55 | * @return string |
||
56 | */ |
||
57 | 10 | protected function formatClassName($className) |
|
65 | |||
66 | /** |
||
67 | * @param mixed $value |
||
68 | * @return string |
||
69 | */ |
||
70 | 4 | protected function formatValue($value) |
|
100 | } |
||
101 |
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.