1 | <?php |
||
11 | trait DocumentTrait |
||
12 | { |
||
13 | /** |
||
14 | * @var \ReflectionClass |
||
15 | */ |
||
16 | protected $reflection; |
||
17 | |||
18 | /** |
||
19 | * @var NodeToArray |
||
20 | */ |
||
21 | protected $nodeToArrayHandler; |
||
22 | |||
23 | /** |
||
24 | * @param string $name |
||
25 | * @return AttributeNode |
||
26 | */ |
||
27 | public function createAttributeNode($name) |
||
36 | |||
37 | /** |
||
38 | * @param string $name |
||
39 | * @return ValueNode |
||
40 | */ |
||
41 | public function createValueNode($name) |
||
50 | |||
51 | /** |
||
52 | * @param string $name |
||
53 | * @return ObjectNode |
||
54 | */ |
||
55 | public function createObjectNode($name) |
||
64 | |||
65 | /** |
||
66 | * @param string $name |
||
67 | * @return ArrayNode |
||
68 | */ |
||
69 | public function createArrayNode($name) |
||
78 | |||
79 | /** |
||
80 | * @param AbstractNode $node |
||
81 | * @param int $options |
||
82 | * @param \Closure $filter |
||
83 | * @return string |
||
84 | * @throws \Exception |
||
85 | */ |
||
86 | public function save(AbstractNode $node = null, $options = 0, \Closure $filter = null) |
||
100 | |||
101 | /** |
||
102 | * @return NodeToArray |
||
103 | */ |
||
104 | protected function getNodeToArrayHandler() |
||
117 | |||
118 | /** |
||
119 | * @source https://github.com/gajus/marray/blob/master/src/marray.php |
||
120 | * @copyright Copyright (c) 2013-2014, Anuary (http://anuary.com/) |
||
121 | * @param array $array |
||
122 | * @param callable $callback |
||
123 | * @return array |
||
124 | */ |
||
125 | protected function walkRecursiveRemove(array $array, callable $callback) |
||
139 | } |
||
140 |
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.