| Conditions | 9 |
| Paths | 33 |
| Total Lines | 34 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | public function render($r) |
||
| 6 | { |
||
| 7 | if (!($r instanceof Kint_Object_Representation_Docstring)) { |
||
| 8 | return false; |
||
| 9 | } |
||
| 10 | |||
| 11 | $docstring = array(); |
||
| 12 | foreach (explode("\n", $r->contents) as $line) { |
||
| 13 | $docstring[] = trim($line); |
||
| 14 | } |
||
| 15 | |||
| 16 | $docstring = implode("\n", $docstring); |
||
| 17 | |||
| 18 | $location = array(); |
||
| 19 | |||
| 20 | if ($r->class) { |
||
| 21 | $location[] = 'Inherited from '.$this->renderer->escape($r->class); |
||
| 22 | } |
||
| 23 | if ($r->file && $r->line) { |
||
| 24 | $location[] = 'Defined in '.$this->renderer->escape(Kint::shortenPath($r->file)).':'.((int) $r->line); |
||
| 25 | } |
||
| 26 | |||
| 27 | if ($location) { |
||
| 28 | if (strlen($docstring)) { |
||
| 29 | $docstring .= "\n\n"; |
||
| 30 | } |
||
| 31 | |||
| 32 | $location = '<small>'.implode("\n", $location).'</small>'; |
||
| 33 | } elseif (strlen($docstring) === 0) { |
||
| 34 | return ''; |
||
| 35 | } |
||
| 36 | |||
| 37 | return '<pre>'.$this->renderer->escape($docstring).$location.'</pre>'; |
||
| 38 | } |
||
| 39 | } |
||
| 40 |
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.