Kint_Renderer_Rich_Docstring does not seem to conform to the naming convention (^[A-Z][a-zA-Z0-9]*$).
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.
Avoid variables with short names like $r. Configured minimum length is 3.
Short variable names may make your code harder to understand. Variable names should
be self-descriptive. This check looks for variable names who are shorter than
a configured minimum.
Loading history...
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);
The expression $location of type array is implicitly converted to a boolean; are you sure this is intended? If so, consider using ! empty($expr) instead to make it clear that you intend to check for an array without elements.
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an
empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using empty(..) or !empty(...) instead.
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.