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 | class Kint_Renderer_Plain extends Kint_Renderer_Text |
||
0 ignored issues
–
show
The property $pre_render_sources is not named in camelCase.
This check marks property names that have not been written in camelCase. In camelCase names are written without any punctuation, the start of each new word being marked
by a capital letter. Thus the name database connection string becomes ![]() The property $disable_utf8 is not named in camelCase.
This check marks property names that have not been written in camelCase. In camelCase names are written without any punctuation, the start of each new word being marked
by a capital letter. Thus the name database connection string becomes ![]() The property $been_run is not named in camelCase.
This check marks property names that have not been written in camelCase. In camelCase names are written without any punctuation, the start of each new word being marked
by a capital letter. Thus the name database connection string becomes ![]() The property $mod_return is not named in camelCase.
This check marks property names that have not been written in camelCase. In camelCase names are written without any punctuation, the start of each new word being marked
by a capital letter. Thus the name database connection string becomes ![]() The property $file_link_format is not named in camelCase.
This check marks property names that have not been written in camelCase. In camelCase names are written without any punctuation, the start of each new word being marked
by a capital letter. Thus the name database connection string becomes ![]() |
|||
4 | { |
||
5 | public static $pre_render_sources = array( |
||
0 ignored issues
–
show
$pre_render_sources 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. ![]() |
|||
6 | 'script' => array(), |
||
7 | 'style' => array( |
||
8 | array('Kint_Renderer_Plain', 'renderCss'), |
||
9 | ), |
||
10 | 'raw' => array(), |
||
11 | ); |
||
12 | |||
13 | /** |
||
14 | * Path to the CSS file to load by default. |
||
15 | * |
||
16 | * @var string |
||
17 | */ |
||
18 | public static $theme = 'plain.css'; |
||
19 | |||
20 | /** |
||
21 | * Output htmlentities instead of utf8. |
||
22 | * |
||
23 | * @var bool |
||
24 | */ |
||
25 | public static $disable_utf8 = false; |
||
0 ignored issues
–
show
$disable_utf8 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. ![]() |
|||
26 | |||
27 | protected static $been_run = false; |
||
0 ignored issues
–
show
$been_run 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. ![]() |
|||
28 | |||
29 | protected $mod_return = false; |
||
0 ignored issues
–
show
$mod_return 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. ![]() |
|||
30 | protected $file_link_format = false; |
||
0 ignored issues
–
show
$file_link_format 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. ![]() |
|||
31 | |||
32 | public function __construct(array $params = array()) |
||
33 | { |
||
34 | parent::__construct($params); |
||
35 | |||
36 | if (isset($params['settings']['return'])) { |
||
37 | $this->mod_return = $params['settings']['return']; |
||
38 | } |
||
39 | |||
40 | if (isset($params['settings']['file_link_format'])) { |
||
41 | $this->file_link_format = $params['settings']['file_link_format']; |
||
42 | } |
||
43 | } |
||
44 | |||
45 | View Code Duplication | protected function utf8_to_htmlentity($string) |
|
0 ignored issues
–
show
function utf8_to_htmlentity() 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. ![]() The return type could not be reliably inferred; please add a
@return annotation.
Our type inference engine in quite powerful, but sometimes the code does not
provide enough clues to go by. In these cases we request you to add a ![]() This method seems to be duplicated in 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. ![]() |
|||
46 | { |
||
47 | return str_replace( |
||
48 | array('┌', '═', '┐', '│', '└', '─', '┘'), |
||
49 | array('┌', '═', '┐', '│', '└', '─', '┘'), |
||
50 | $string |
||
51 | ); |
||
52 | } |
||
53 | |||
54 | public function colorValue($string) |
||
55 | { |
||
56 | return '<i>'.$string.'</i>'; |
||
57 | } |
||
58 | |||
59 | public function colorType($string) |
||
60 | { |
||
61 | return '<b>'.$string.'</b>'; |
||
62 | } |
||
63 | |||
64 | public function colorTitle($string) |
||
65 | { |
||
66 | return '<u>'.$string.'</u>'; |
||
67 | } |
||
68 | |||
69 | public function renderTitle(Kint_Object $o) |
||
0 ignored issues
–
show
The return type could not be reliably inferred; please add a
@return annotation.
Our type inference engine in quite powerful, but sometimes the code does not
provide enough clues to go by. In these cases we request you to add a ![]() |
|||
70 | { |
||
71 | if (self::$disable_utf8) { |
||
72 | return $this->utf8_to_htmlentity(parent::renderTitle($o)); |
||
73 | } else { |
||
74 | return parent::renderTitle($o); |
||
75 | } |
||
76 | } |
||
77 | |||
78 | View Code Duplication | protected static function renderCss() |
|
0 ignored issues
–
show
This method seems to be duplicated in 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. ![]() |
|||
79 | { |
||
80 | if (file_exists(KINT_DIR.'/resources/compiled/'.self::$theme)) { |
||
81 | return file_get_contents(KINT_DIR.'/resources/compiled/'.self::$theme); |
||
82 | } else { |
||
83 | return file_get_contents(self::$theme); |
||
84 | } |
||
85 | } |
||
86 | |||
87 | View Code Duplication | public function preRender() |
|
0 ignored issues
–
show
This method seems to be duplicated in 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. ![]() |
|||
88 | { |
||
89 | $output = ''; |
||
90 | |||
91 | if (!self::$been_run || $this->mod_return) { |
||
92 | foreach (self::$pre_render_sources as $type => $values) { |
||
93 | $contents = ''; |
||
94 | foreach ($values as $v) { |
||
95 | if (is_callable($v)) { |
||
96 | $contents .= call_user_func($v, $this); |
||
97 | } elseif (is_string($v)) { |
||
98 | $contents .= $v; |
||
99 | } |
||
100 | } |
||
101 | |||
102 | if (!strlen($contents)) { |
||
103 | continue; |
||
104 | } |
||
105 | |||
106 | switch ($type) { |
||
107 | case 'script': |
||
108 | $output .= '<script class="kint-script">'.$contents.'</script>'; |
||
109 | break; |
||
110 | case 'style': |
||
111 | $output .= '<style class="kint-style">'.$contents.'</style>'; |
||
112 | break; |
||
113 | default: |
||
114 | $output .= $contents; |
||
115 | } |
||
116 | } |
||
117 | |||
118 | if (!$this->mod_return) { |
||
119 | self::$been_run = true; |
||
120 | } |
||
121 | } |
||
122 | |||
123 | return $output.'<div class="kint-plain">'; |
||
124 | } |
||
125 | |||
126 | public function postRender() |
||
127 | { |
||
128 | if (self::$disable_utf8) { |
||
129 | return $this->utf8_to_htmlentity(parent::postRender()).'</div>'; |
||
130 | } else { |
||
131 | return parent::postRender().'</div>'; |
||
132 | } |
||
133 | } |
||
134 | |||
135 | View Code Duplication | public function ideLink($file, $line) |
|
0 ignored issues
–
show
The return type could not be reliably inferred; please add a
@return annotation.
Our type inference engine in quite powerful, but sometimes the code does not
provide enough clues to go by. In these cases we request you to add a ![]() This method seems to be duplicated in 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. ![]() |
|||
136 | { |
||
137 | $shortenedPath = $this->escape(Kint::shortenPath($file)); |
||
138 | if (!$this->file_link_format) { |
||
139 | return $shortenedPath.':'.$line; |
||
140 | } |
||
141 | |||
142 | $ideLink = Kint::getIdeLink($file, $line); |
||
143 | $class = (strpos($ideLink, 'http://') === 0) ? 'class="kint-ide-link" ' : ''; |
||
144 | |||
145 | return "<a {$class}href=\"{$ideLink}\">{$shortenedPath}:{$line}</a>"; |
||
146 | } |
||
147 | |||
148 | View Code Duplication | public function escape($string, $encoding = false) |
|
0 ignored issues
–
show
This method seems to be duplicated in 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. ![]() |
|||
149 | { |
||
150 | if ($encoding === false) { |
||
151 | $encoding = Kint_Object_Blob::detectEncoding($string); |
||
0 ignored issues
–
show
|
|||
152 | } |
||
153 | |||
154 | $original_encoding = $encoding; |
||
0 ignored issues
–
show
$original_encoding 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. ![]() |
|||
155 | |||
156 | if ($encoding === false || $encoding === 'ASCII') { |
||
157 | $encoding = 'UTF-8'; |
||
0 ignored issues
–
show
|
|||
158 | } |
||
159 | |||
160 | $string = htmlspecialchars($string, ENT_NOQUOTES, $encoding); |
||
0 ignored issues
–
show
|
|||
161 | |||
162 | // this call converts all non-ASCII characters into numeirc htmlentities |
||
163 | if (extension_loaded('mbstring') && $original_encoding !== 'ASCII') { |
||
0 ignored issues
–
show
$original_encoding 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. ![]() |
|||
164 | $string = mb_encode_numericentity($string, array(0x80, 0xffff, 0, 0xffff), $encoding); |
||
0 ignored issues
–
show
|
|||
165 | } |
||
166 | |||
167 | return $string; |
||
168 | } |
||
169 | } |
||
170 |
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.