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 integer $times How much indentation needed to be repeated |
||
38 | * @param bool $addingTabs Whether appending tab character after each indentation |
||
39 | * @return string |
||
40 | */ |
||
41 | 1 | public function indenting($times = 1, $addingTabs = false) |
|
52 | |||
53 | /** |
||
54 | * @param \TokenReflection\IReflectionClass $declaringClass The class using the namespace aliases |
||
55 | * @param string $aliasedClassName The class name used in the declaring class |
||
56 | * @return string |
||
57 | */ |
||
58 | 3 | protected function expandNamespaceAlias(IReflectionClass $declaringClass, $aliasedClassName) |
|
69 | |||
70 | /** |
||
71 | * @param string $className |
||
72 | * @return string |
||
73 | */ |
||
74 | 10 | protected function formatClassName($className) |
|
82 | |||
83 | /** |
||
84 | * @param mixed $value |
||
85 | * @return string |
||
86 | */ |
||
87 | 4 | protected function formatValue($value, $_arrayDepth = 0) |
|
122 | } |
||
123 |
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.