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 | namespace nstdio\svg\xml; |
||
3 | |||
4 | use nstdio\svg\util\KeyValueWriter; |
||
5 | use nstdio\svg\XMLDocumentInterface; |
||
6 | |||
7 | /** |
||
8 | * Class DOMNode |
||
9 | * |
||
10 | * @package nstdio\svg\xml |
||
11 | * @author Edgar Asatryan <[email protected]> |
||
12 | */ |
||
13 | abstract class DOMNode implements XMLDocumentInterface |
||
14 | { |
||
15 | /** |
||
16 | * @inheritdoc |
||
17 | */ |
||
18 | abstract public function setNodeValue($value); |
||
19 | |||
20 | /** |
||
21 | * @inheritdoc |
||
22 | */ |
||
23 | abstract public function getNodeValue(); |
||
24 | |||
25 | /** |
||
26 | * @inheritdoc |
||
27 | */ |
||
28 | 9 | public function attributes(array $except = []) |
|
29 | { |
||
30 | 9 | return KeyValueWriter::allAttributes($this->getElement(), $except); |
|
0 ignored issues
–
show
|
|||
31 | } |
||
32 | |||
33 | /** |
||
34 | * @inheritdoc |
||
35 | */ |
||
36 | abstract public function getElement(); |
||
37 | |||
38 | /** |
||
39 | * @inheritdoc |
||
40 | */ |
||
41 | 150 | public function setAttribute($name, $value = null) |
|
42 | { |
||
43 | 150 | $this->getElement()->setAttribute($name, $value); |
|
0 ignored issues
–
show
The method
setAttribute does only exist in DOMElement and nstdio\svg\XMLDocumentInterface , but not in DOMDocument .
It seems like the method you are trying to call exists only in some of the possible types. Let’s take a look at an example: class A
{
public function foo() { }
}
class B extends A
{
public function bar() { }
}
/**
* @param A|B $x
*/
function someFunction($x)
{
$x->foo(); // This call is fine as the method exists in A and B.
$x->bar(); // This method only exists in B and might cause an error.
}
Available Fixes
![]() |
|||
44 | 150 | } |
|
45 | |||
46 | /** |
||
47 | * @inheritdoc |
||
48 | */ |
||
49 | 109 | public function getAttribute($name) |
|
50 | { |
||
51 | 109 | return $this->getElement()->getAttribute($name); |
|
0 ignored issues
–
show
The method
getAttribute does only exist in DOMElement and nstdio\svg\XMLDocumentInterface , but not in DOMDocument .
It seems like the method you are trying to call exists only in some of the possible types. Let’s take a look at an example: class A
{
public function foo() { }
}
class B extends A
{
public function bar() { }
}
/**
* @param A|B $x
*/
function someFunction($x)
{
$x->foo(); // This call is fine as the method exists in A and B.
$x->bar(); // This method only exists in B and might cause an error.
}
Available Fixes
![]() |
|||
52 | } |
||
53 | |||
54 | /** |
||
55 | * @inheritdoc |
||
56 | */ |
||
57 | 150 | public function setAttributeNS($namespaceURI, $qualifiedName, $value) |
|
58 | { |
||
59 | 150 | $this->getElement()->setAttributeNS($namespaceURI, $qualifiedName, $value); |
|
0 ignored issues
–
show
The method
setAttributeNS does only exist in DOMElement and nstdio\svg\XMLDocumentInterface , but not in DOMDocument .
It seems like the method you are trying to call exists only in some of the possible types. Let’s take a look at an example: class A
{
public function foo() { }
}
class B extends A
{
public function bar() { }
}
/**
* @param A|B $x
*/
function someFunction($x)
{
$x->foo(); // This call is fine as the method exists in A and B.
$x->bar(); // This method only exists in B and might cause an error.
}
Available Fixes
![]() |
|||
60 | 150 | } |
|
61 | |||
62 | /** |
||
63 | * @inheritdoc |
||
64 | */ |
||
65 | 81 | public function getAttributeNS($namespaceURI, $localName) |
|
66 | { |
||
67 | 81 | return $this->getElement()->getAttributeNS($namespaceURI, $localName); |
|
0 ignored issues
–
show
The method
getAttributeNS does only exist in DOMElement and nstdio\svg\XMLDocumentInterface , but not in DOMDocument .
It seems like the method you are trying to call exists only in some of the possible types. Let’s take a look at an example: class A
{
public function foo() { }
}
class B extends A
{
public function bar() { }
}
/**
* @param A|B $x
*/
function someFunction($x)
{
$x->foo(); // This call is fine as the method exists in A and B.
$x->bar(); // This method only exists in B and might cause an error.
}
Available Fixes
![]() |
|||
68 | } |
||
69 | |||
70 | 150 | public function appendChild(XMLDocumentInterface $newNode) |
|
71 | { |
||
72 | 150 | $this->getElement()->appendChild($newNode->getElement()); |
|
0 ignored issues
–
show
It seems like
$newNode->getElement() targeting nstdio\svg\XMLDocumentInterface::getElement() can also be of type object<DOMDocument> or object<DOMElement> ; however, nstdio\svg\XMLDocumentInterface::appendChild() does only seem to accept object<nstdio\svg\XMLDocumentInterface> , maybe add an additional type check?
This check looks at variables that are passed out again to other methods. If the outgoing method call has stricter type requirements than the method itself, an issue is raised. An additional type check may prevent trouble. ![]() |
|||
73 | 150 | } |
|
74 | |||
75 | /** |
||
76 | * @inheritdoc |
||
77 | */ |
||
78 | 150 | public function createElement($name, $value = null) |
|
79 | { |
||
80 | // on PHP 5.4.* createElement method with null parameter will create empty DOMText object as child of created element |
||
81 | 150 | $element = $value === null ? $this->getElement()->createElement($name) : $this->getElement()->createElement($name, $value); |
|
0 ignored issues
–
show
The method
createElement does only exist in DOMDocument and nstdio\svg\XMLDocumentInterface , but not in DOMElement .
It seems like the method you are trying to call exists only in some of the possible types. Let’s take a look at an example: class A
{
public function foo() { }
}
class B extends A
{
public function bar() { }
}
/**
* @param A|B $x
*/
function someFunction($x)
{
$x->foo(); // This call is fine as the method exists in A and B.
$x->bar(); // This method only exists in B and might cause an error.
}
Available Fixes
![]() |
|||
82 | |||
83 | 150 | return new DOMElementWrapper($element); |
|
84 | } |
||
85 | |||
86 | /** |
||
87 | * @inheritdoc |
||
88 | */ |
||
89 | public function createElementNS($namespaceURI, $qualifiedName, $value = null) |
||
90 | { |
||
91 | return $this->getElement()->createElementNS($namespaceURI, $qualifiedName, $value); |
||
0 ignored issues
–
show
The method
createElementNS does only exist in DOMDocument and nstdio\svg\XMLDocumentInterface , but not in DOMElement .
It seems like the method you are trying to call exists only in some of the possible types. Let’s take a look at an example: class A
{
public function foo() { }
}
class B extends A
{
public function bar() { }
}
/**
* @param A|B $x
*/
function someFunction($x)
{
$x->foo(); // This call is fine as the method exists in A and B.
$x->bar(); // This method only exists in B and might cause an error.
}
Available Fixes
![]() |
|||
92 | } |
||
93 | |||
94 | /** |
||
95 | * @inheritdoc |
||
96 | */ |
||
97 | 9 | public function removeNode(XMLDocumentInterface $child) |
|
98 | { |
||
99 | 9 | return $this->getElement()->removeChild($child->getElement()); |
|
0 ignored issues
–
show
The method
removeChild does only exist in DOMDocument and DOMElement , but not in nstdio\svg\XMLDocumentInterface .
It seems like the method you are trying to call exists only in some of the possible types. Let’s take a look at an example: class A
{
public function foo() { }
}
class B extends A
{
public function bar() { }
}
/**
* @param A|B $x
*/
function someFunction($x)
{
$x->foo(); // This call is fine as the method exists in A and B.
$x->bar(); // This method only exists in B and might cause an error.
}
Available Fixes
![]() |
|||
100 | } |
||
101 | |||
102 | /** |
||
103 | * @inheritdoc |
||
104 | */ |
||
105 | 61 | public function saveHTML() |
|
106 | { |
||
107 | 61 | return $this->getElement()->saveHTML(); |
|
0 ignored issues
–
show
The method
saveHTML does only exist in DOMDocument and nstdio\svg\XMLDocumentInterface , but not in DOMElement .
It seems like the method you are trying to call exists only in some of the possible types. Let’s take a look at an example: class A
{
public function foo() { }
}
class B extends A
{
public function bar() { }
}
/**
* @param A|B $x
*/
function someFunction($x)
{
$x->foo(); // This call is fine as the method exists in A and B.
$x->bar(); // This method only exists in B and might cause an error.
}
Available Fixes
![]() |
|||
108 | } |
||
109 | |||
110 | 2 | public function saveXML($formatOutput) |
|
111 | { |
||
112 | 2 | return $this->getElement()->saveXML(); |
|
0 ignored issues
–
show
The method
saveXML does only exist in DOMDocument and nstdio\svg\XMLDocumentInterface , but not in DOMElement .
It seems like the method you are trying to call exists only in some of the possible types. Let’s take a look at an example: class A
{
public function foo() { }
}
class B extends A
{
public function bar() { }
}
/**
* @param A|B $x
*/
function someFunction($x)
{
$x->foo(); // This call is fine as the method exists in A and B.
$x->bar(); // This method only exists in B and might cause an error.
}
Available Fixes
![]() |
|||
113 | } |
||
114 | |||
115 | /** |
||
116 | * @inheritdoc |
||
117 | */ |
||
118 | 150 | public static function isLoaded() |
|
119 | { |
||
120 | 150 | return extension_loaded('dom'); |
|
121 | } |
||
122 | |||
123 | public function __debugInfo() |
||
124 | { |
||
125 | return [ |
||
126 | 'nodeName' => $this->getElement()->nodeName, |
||
127 | ]; |
||
128 | } |
||
129 | } |
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.