Conditions | 8 |
Paths | 7 |
Total Lines | 24 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
8 | public static function dump($var, $expand = true) |
||
9 | { |
||
10 | $i = 0; |
||
11 | $line = null; |
||
12 | foreach (debug_backtrace() as $item) { |
||
13 | try { |
||
14 | $source = sprintf('%s. dumped from <em>%s</em>%s<strong>%s</strong> (line %s)', |
||
15 | count(self::$dump) + 1, |
||
16 | isset($item['class']) ? (is_object($item['class']) ? get_class($item['class']) : $item['class']) : '<unknown class> (in <span style=\'font-size: 0.8em;\'>'.print_r($item['args'][0]).'</span>)', |
||
17 | // Assume of no classname is available, dumped from template.. (naive) |
||
18 | !empty($item['type']) ? $item['type'] : '::', |
||
19 | !empty($item['function']) ? $item['function'] : '<unknown function>', |
||
20 | $line); |
||
21 | $line = issetor($item['line'], null); |
||
|
|||
22 | } catch (Exception $e) { |
||
23 | } |
||
24 | |||
25 | if ($i == 2) { |
||
26 | break; |
||
27 | } |
||
28 | $i++; |
||
29 | } |
||
30 | self::$dump[$source] = [$var, $expand]; |
||
31 | } |
||
32 | |||
48 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.