| Conditions | 6 |
| Paths | 4 |
| Total Lines | 22 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function parse(&$var, Kint_Object &$o, $trigger) |
||
| 23 | { |
||
| 24 | if (is_string($var) && !ctype_digit($var)) { |
||
| 25 | return; |
||
| 26 | } |
||
| 27 | |||
| 28 | if (in_array($var, self::$blacklist)) { |
||
| 29 | return; |
||
| 30 | } |
||
| 31 | |||
| 32 | $len = strlen($var); |
||
| 33 | |||
| 34 | // Guess for anything between March 1973 and November 2286 |
||
| 35 | if ($len === 9 || $len === 10) { |
||
| 36 | // If it's an int or string that's this short it probably has no other meaning |
||
| 37 | // Additionally it's highly unlikely the shortValue will be clipped for length |
||
| 38 | // If you're writing a plugin that interferes with this, just put your |
||
| 39 | // parser plugin further down the list so that it gets loaded afterwards. |
||
| 40 | $o->value->label = 'Timestamp'; |
||
| 41 | $o->value->hints[] = 'timestamp'; |
||
| 42 | } |
||
| 43 | } |
||
| 44 | } |
||
| 45 |
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.