This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | abstract class Kint_Renderer_Rich_Plugin |
||
0 ignored issues
–
show
Kint_Renderer_Rich_Plugin does not seem to conform to the naming convention (^Abstract|Factory$ ).
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. ![]() |
|||
4 | { |
||
5 | protected $renderer; |
||
6 | |||
7 | public function __construct(Kint_Renderer_Rich $r) |
||
0 ignored issues
–
show
|
|||
8 | { |
||
9 | $this->renderer = $r; |
||
10 | } |
||
11 | |||
12 | /** |
||
13 | * Renders a locked header. |
||
14 | * |
||
15 | * This is a placeholder until Kint 3 when it can be renamed to |
||
16 | * renderLockedHeader after the deprecated static method is removed |
||
17 | */ |
||
18 | public function renderHeaderLocked(Kint_Object $o, $content) |
||
0 ignored issues
–
show
|
|||
19 | { |
||
20 | $header = '<dt class="kint-parent kint-locked">'; |
||
21 | |||
22 | View Code Duplication | if (Kint_Renderer_Rich::$access_paths && $o->depth > 0 && $ap = $o->getAccessPath()) { |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
23 | $header .= '<span class="kint-access-path-trigger" title="Show access path">⇄</span>'; |
||
24 | } |
||
25 | |||
26 | $header .= '<span class="kint-popup-trigger" title="Open in new window">→</span><nav></nav>'; |
||
27 | |||
28 | if (($s = $o->getModifiers()) !== null) { |
||
0 ignored issues
–
show
|
|||
29 | $header .= '<var>'.$s.'</var> '; |
||
30 | } |
||
31 | |||
32 | View Code Duplication | if (($s = $o->getName()) !== null) { |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
33 | $header .= '<dfn>'.$this->renderer->escape($s).'</dfn> '; |
||
34 | |||
35 | if ($s = $o->getOperator()) { |
||
36 | $header .= $this->renderer->escape($s, 'ASCII').' '; |
||
0 ignored issues
–
show
'ASCII' is of type string , but the function expects a boolean .
It seems like the type of the argument is not accepted by the function/method which you are calling. In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug. We suggest to add an explicit type cast like in the following example: function acceptsInteger($int) { }
$x = '123'; // string "123"
// Instead of
acceptsInteger($x);
// we recommend to use
acceptsInteger((integer) $x);
![]() |
|||
37 | } |
||
38 | } |
||
39 | |||
40 | if (($s = $o->getType()) !== null) { |
||
41 | $s = $this->renderer->escape($s); |
||
42 | |||
43 | if ($o->reference) { |
||
44 | $s = '&'.$s; |
||
45 | } |
||
46 | |||
47 | $header .= '<var>'.$s.'</var> '; |
||
48 | } |
||
49 | |||
50 | View Code Duplication | if (($s = $o->getSize()) !== null) { |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
51 | $header .= '('.$this->renderer->escape($s).') '; |
||
52 | } |
||
53 | |||
54 | $header .= $content; |
||
55 | |||
56 | if (!empty($ap)) { |
||
57 | $header .= '<div class="access-path">'.$this->renderer->escape($ap).'</div>'; |
||
58 | } |
||
59 | |||
60 | return $header.'</dt>'; |
||
61 | } |
||
62 | |||
63 | public static function renderLockedHeader(Kint_Object $o, $content) |
||
0 ignored issues
–
show
|
|||
64 | { |
||
65 | static $show_dep = true; |
||
66 | |||
67 | View Code Duplication | if ($show_dep) { |
|
0 ignored issues
–
show
$show_dep 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. ![]() This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
68 | trigger_error('Kint_Renderer_Rich_Plugin::renderLockedHeader() is deprecated and will be removed in Kint 3.0. Use renderHeaderLocked instead.', KINT_PHP53 ? E_USER_DEPRECATED : E_USER_NOTICE); |
||
69 | $show_dep = false; |
||
0 ignored issues
–
show
$show_dep 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. ![]() |
|||
70 | } |
||
71 | |||
72 | $header = '<dt class="kint-parent kint-locked">'; |
||
73 | |||
74 | View Code Duplication | if (Kint_Renderer_Rich::$access_paths && $o->depth > 0 && $ap = $o->getAccessPath()) { |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
75 | $header .= '<span class="kint-access-path-trigger" title="Show access path">⇄</span>'; |
||
76 | } |
||
77 | |||
78 | $header .= '<span class="kint-popup-trigger" title="Open in new window">→</span><nav></nav>'; |
||
79 | |||
80 | if (($s = $o->getModifiers()) !== null) { |
||
0 ignored issues
–
show
|
|||
81 | $header .= '<var>'.$s.'</var> '; |
||
82 | } |
||
83 | |||
84 | View Code Duplication | if (($s = $o->getName()) !== null) { |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
85 | $header .= '<dfn>'.Kint_Object_Blob::escape($s).'</dfn> '; |
||
86 | |||
87 | if ($s = $o->getOperator()) { |
||
88 | $header .= Kint_Object_Blob::escape($s, 'ASCII').' '; |
||
0 ignored issues
–
show
'ASCII' is of type string , but the function expects a boolean .
It seems like the type of the argument is not accepted by the function/method which you are calling. In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug. We suggest to add an explicit type cast like in the following example: function acceptsInteger($int) { }
$x = '123'; // string "123"
// Instead of
acceptsInteger($x);
// we recommend to use
acceptsInteger((integer) $x);
![]() |
|||
89 | } |
||
90 | } |
||
91 | |||
92 | View Code Duplication | if (($s = $o->getType()) !== null) { |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
93 | $s = Kint_Object_Blob::escape($s); |
||
94 | |||
95 | if ($o->reference) { |
||
96 | $s = '&'.$s; |
||
97 | } |
||
98 | |||
99 | $header .= '<var>'.$s.'</var> '; |
||
100 | } |
||
101 | |||
102 | View Code Duplication | if (($s = $o->getSize()) !== null) { |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
103 | $header .= '('.Kint_Object_Blob::escape($s).') '; |
||
104 | } |
||
105 | |||
106 | $header .= $content; |
||
107 | |||
108 | if (!empty($ap)) { |
||
109 | $header .= '<div class="access-path">'.Kint_Object_Blob::escape($ap).'</div>'; |
||
110 | } |
||
111 | |||
112 | return $header.'</dt>'; |
||
113 | } |
||
114 | |||
115 | abstract public function render($o); |
||
0 ignored issues
–
show
For interfaces and abstract methods it is generally a good practice to add a
@return annotation even if it is just @return void or @return null , so that implementors know what to do in the overridden method.
For interface and abstract methods, it is impossible to infer the return type
from the immediate code. In these cases, it is generally advisible to explicitly
annotate these methods with a ![]() |
|||
116 | } |
||
117 |
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.