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_Parser_SimpleXMLElement extends Kint_Parser_Plugin |
||
0 ignored issues
–
show
|
|||
4 | { |
||
5 | /** |
||
6 | * Show all properties and methods. |
||
7 | * |
||
8 | * @var bool |
||
9 | */ |
||
10 | public static $verbose = false; |
||
11 | |||
12 | public function getTypes() |
||
13 | { |
||
14 | return array('object'); |
||
15 | } |
||
16 | |||
17 | public function getTriggers() |
||
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 ![]() |
|||
18 | { |
||
19 | return Kint_Parser::TRIGGER_SUCCESS; |
||
20 | } |
||
21 | |||
22 | public function parse(&$var, Kint_Object &$o, $trigger) |
||
0 ignored issues
–
show
|
|||
23 | { |
||
24 | if (!$var instanceof SimpleXMLElement) { |
||
25 | return; |
||
26 | } |
||
27 | |||
28 | $o->hints[] = 'simplexml_element'; |
||
29 | |||
30 | if (!self::$verbose) { |
||
31 | $o->removeRepresentation('properties'); |
||
32 | $o->removeRepresentation('iterator'); |
||
33 | $o->removeRepresentation('methods'); |
||
34 | } |
||
35 | |||
36 | // Attributes |
||
37 | $a = new Kint_Object_Representation('Attributes'); |
||
0 ignored issues
–
show
|
|||
38 | |||
39 | $base_obj = new Kint_Object(); |
||
0 ignored issues
–
show
$base_obj 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. ![]() |
|||
40 | $base_obj->depth = $o->depth; |
||
0 ignored issues
–
show
$base_obj 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. ![]() |
|||
41 | |||
42 | if ($o->access_path) { |
||
0 ignored issues
–
show
The expression
$o->access_path of type string|null is loosely compared to true ; this is ambiguous if the string can be empty. You might want to explicitly use !== null instead.
In PHP, under loose comparison (like For '' == false // true
'' == null // true
'ab' == false // false
'ab' == null // false
// It is often better to use strict comparison
'' === false // false
'' === null // false
![]() |
|||
43 | $base_obj->access_path = '(string) '.$o->access_path; |
||
0 ignored issues
–
show
$base_obj 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. ![]() |
|||
44 | } |
||
45 | |||
46 | if ($var->attributes()) { |
||
47 | $attribs = iterator_to_array($var->attributes()); |
||
48 | $attribs = array_map('strval', $attribs); |
||
49 | } else { |
||
50 | $attribs = array(); |
||
51 | } |
||
52 | |||
53 | // XML attributes are by definition strings and don't have children, |
||
54 | // so up the depth limit in case we're just below the limit since |
||
55 | // there won't be any recursive stuff anyway. |
||
56 | $depth_stash = $this->parser->max_depth; |
||
0 ignored issues
–
show
$depth_stash 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. ![]() |
|||
57 | $this->parser->max_depth = 0; |
||
58 | $a->contents = $this->parser->parse($attribs, $base_obj); |
||
0 ignored issues
–
show
$base_obj 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. ![]() It seems like
$this->parser->parse($attribs, $base_obj) of type object<Kint_Object> is incompatible with the declared type array of property $contents .
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property. Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property.. ![]() |
|||
59 | $this->parser->max_depth = $depth_stash; |
||
0 ignored issues
–
show
$depth_stash 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. ![]() |
|||
60 | |||
61 | $a->contents = $a->contents->value->contents; |
||
62 | |||
63 | $o->addRepresentation($a, 0); |
||
64 | |||
65 | // Children |
||
66 | // We need to check children() separately from the values we already parsed because |
||
67 | // text contents won't show up in children() but they will show up in properties. |
||
68 | // |
||
69 | // Why do we still need to check for attributes if we already have an attributes() |
||
70 | // method? Hell if I know! |
||
71 | $children = $var->children(); |
||
72 | |||
73 | if ($o->value) { |
||
74 | $c = new Kint_Object_Representation('Children'); |
||
0 ignored issues
–
show
|
|||
75 | |||
76 | foreach ($o->value->contents as $value) { |
||
77 | if ($value->name === '@attributes') { |
||
78 | continue; |
||
79 | } elseif (isset($children->{$value->name})) { |
||
80 | $i = 0; |
||
81 | |||
82 | while (isset($children->{$value->name}[$i])) { |
||
83 | $base_obj = new Kint_Object(); |
||
0 ignored issues
–
show
$base_obj 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. ![]() |
|||
84 | $base_obj->depth = $o->depth + 1; |
||
0 ignored issues
–
show
$base_obj 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. ![]() |
|||
85 | $base_obj->name = $value->name; |
||
0 ignored issues
–
show
$base_obj 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. ![]() |
|||
86 | if ($value->access_path) { |
||
87 | $base_obj->access_path = $value->access_path.'['.$i.']'; |
||
0 ignored issues
–
show
$base_obj 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. ![]() |
|||
88 | } |
||
89 | |||
90 | $value = $this->parser->parse($children->{$value->name}[$i], $base_obj); |
||
0 ignored issues
–
show
$base_obj 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. ![]() |
|||
91 | |||
92 | if ($value->access_path && $value->type === 'string') { |
||
93 | $value->access_path = '(string) '.$value->access_path; |
||
94 | } |
||
95 | |||
96 | $c->contents[] = $value; |
||
97 | |||
98 | ++$i; |
||
99 | } |
||
100 | } |
||
101 | } |
||
102 | |||
103 | $o->size = count($c->contents); |
||
104 | |||
105 | if (!$o->size) { |
||
106 | $o->size = null; |
||
107 | |||
108 | if (strlen((string) $var)) { |
||
109 | $base_obj = new Kint_Object_Blob(); |
||
0 ignored issues
–
show
$base_obj 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. ![]() |
|||
110 | $base_obj->depth = $o->depth + 1; |
||
0 ignored issues
–
show
$base_obj 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. ![]() |
|||
111 | $base_obj->name = $o->name; |
||
0 ignored issues
–
show
$base_obj 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. ![]() |
|||
112 | if ($o->access_path) { |
||
0 ignored issues
–
show
The expression
$o->access_path of type string|null is loosely compared to true ; this is ambiguous if the string can be empty. You might want to explicitly use !== null instead.
In PHP, under loose comparison (like For '' == false // true
'' == null // true
'ab' == false // false
'ab' == null // false
// It is often better to use strict comparison
'' === false // false
'' === null // false
![]() |
|||
113 | $base_obj->access_path = '(string) '.$o->access_path; |
||
0 ignored issues
–
show
$base_obj 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. ![]() |
|||
114 | } |
||
115 | |||
116 | $value = (string) $var; |
||
117 | |||
118 | $depth_stash = $this->parser->max_depth; |
||
0 ignored issues
–
show
$depth_stash 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. ![]() |
|||
119 | $this->parser->max_depth = 0; |
||
120 | $value = $this->parser->parse($value, $base_obj); |
||
0 ignored issues
–
show
$base_obj 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. ![]() |
|||
121 | $this->parser->max_depth = $depth_stash; |
||
0 ignored issues
–
show
$depth_stash 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. ![]() |
|||
122 | |||
123 | $c = new Kint_Object_Representation('Contents'); |
||
124 | $c->implicit_label = true; |
||
125 | $c->contents = array($value); |
||
126 | } |
||
127 | } |
||
128 | |||
129 | $o->addRepresentation($c, 0); |
||
130 | } |
||
131 | } |
||
132 | } |
||
133 |
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.