| Conditions | 6 |
| Paths | 6 |
| Total Lines | 37 |
| Code Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function parse(&$var, Kint_Object &$o, $trigger) |
||
| 21 | { |
||
| 22 | if (!preg_match('/0\.[0-9]{8} [0-9]{10}/', $var)) { |
||
| 23 | return; |
||
| 24 | } |
||
| 25 | |||
| 26 | if ($o->name !== 'microtime()' || $o->depth !== 0) { |
||
| 27 | return; |
||
| 28 | } |
||
| 29 | |||
| 30 | list($usec, $sec) = explode(' ', $var); |
||
| 31 | |||
| 32 | $time = (float) $usec + (float) $sec; |
||
| 33 | |||
| 34 | if (self::$last !== null) { |
||
| 35 | $last_time = array_sum(array_map('floatval', explode(' ', self::$last))); |
||
| 36 | $lap = $time - $last_time; |
||
| 37 | ++self::$times; |
||
| 38 | } else { |
||
| 39 | $lap = null; |
||
| 40 | self::$start = $time; |
||
| 41 | } |
||
| 42 | |||
| 43 | self::$last = $var; |
||
| 44 | |||
| 45 | if ($lap !== null) { |
||
| 46 | $total = $time - self::$start; |
||
| 47 | $r = new Kint_Object_Representation_Microtime(self::$group, $lap, $total, self::$times); |
||
| 48 | } else { |
||
| 49 | $r = new Kint_Object_Representation_Microtime(self::$group); |
||
| 50 | } |
||
| 51 | $r->contents = $var; |
||
| 52 | $r->implicit_label = true; |
||
| 53 | |||
| 54 | $o->removeRepresentation($o->value->name); |
||
| 55 | $o->addRepresentation($r); |
||
| 56 | } |
||
| 57 | |||
| 66 |
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.