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 | ar_pinp::allow('ar_html_table'); |
||
3 | |||
4 | class ar_html_table extends ar_htmlElement { |
||
5 | |||
6 | private $rowHeaderAttributes = null; |
||
7 | private $rowHeaders = null; |
||
8 | |||
9 | public function __construct( $data= null, $attributes = null, $childNodes = null, $parentNode = null ) { |
||
10 | parent::__construct( 'table', $attributes , $childNodes, $parentNode ); |
||
11 | if ( isset($data) ) { |
||
12 | $this->body( $data ); |
||
13 | } |
||
14 | } |
||
15 | |||
16 | public function body( $data ) { |
||
17 | if (!is_array($data) ) { |
||
18 | $data = array( $data ); |
||
19 | } |
||
20 | $rows = $this->getRows($data)->setAttribute( 'class', array( |
||
21 | 'tableFirstLast' => ar::listPattern( 'tableFirst .*', '.* tableLast'), |
||
22 | 'tableOddEven' => ar::listPattern( '(tableOdd tableEven?)*' ) |
||
23 | ) ); |
||
24 | $this->appendChild( |
||
25 | ar_html::tag( |
||
26 | 'tbody', $rows |
||
27 | ) |
||
28 | ); |
||
29 | return $this; |
||
30 | } |
||
31 | |||
32 | private function getRows( $list ) { |
||
33 | $nodes = ar_html::nodes(); |
||
34 | foreach ( $list as $key => $content ) { |
||
35 | if ( !is_array( $content ) ) { |
||
36 | $content = array( $content ); |
||
37 | } |
||
38 | $cells = $this->getCells( $content, 'td')->setAttribute('class', array( |
||
39 | 'tableOddEven' => ar::listPattern( '(tableOdd tableEven?)*' ), |
||
40 | 'tableFirstLast' => ar::listPattern( 'tableFirst .*', '.* tableLast') |
||
41 | ) ); |
||
42 | $nodes[] = ar_html::tag( 'tr', ar_html::nodes( $header, $cells ) ); |
||
0 ignored issues
–
show
|
|||
43 | } |
||
44 | return $nodes; |
||
45 | } |
||
46 | |||
47 | private function getCells( $list, $tag = 'td') { |
||
48 | $nodes = ar_html::nodes(); |
||
49 | foreach ($list as $key => $content ) { |
||
50 | $nodes[] = ar_html::el($tag, $content); |
||
51 | } |
||
52 | return $nodes; |
||
53 | } |
||
54 | |||
55 | View Code Duplication | public function head( $list, $attributes = null ) { |
|
56 | if ( is_array($list) ) { |
||
57 | $nodes = $this->getCells( $list, 'th' ); |
||
58 | $head = $this->thead->firstChild; //current( $this->getElementsByTagName('thead') ); |
||
0 ignored issues
–
show
The property
thead does not exist on object<ar_html_table> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
59 | if ( !isset($head) ) { |
||
60 | $head = ar_html::tag( 'thead', $attributes ); |
||
61 | if ( $foot = $this->tfoot->firstChild ) { |
||
0 ignored issues
–
show
The property
tfoot does not exist on object<ar_html_table> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
62 | $this->insertBefore( $head, $foot ); |
||
63 | } else if ( $body = $this->tbody->firstChild ) { |
||
0 ignored issues
–
show
The property
tbody does not exist on object<ar_html_table> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
64 | $this->insertBefore( $head, $body ); |
||
65 | } else { |
||
66 | $this->appendChild( $head ); |
||
67 | } |
||
68 | } else if (isset($attributes)) { |
||
69 | $head->setAttributes( $attributes ); |
||
70 | } |
||
71 | $head->appendChild( ar_html::tag( 'tr', $nodes ) ); |
||
72 | } |
||
73 | return $this; |
||
74 | } |
||
75 | |||
76 | View Code Duplication | public function foot( $list, $attributes = null ) { |
|
77 | if ( is_array( $list ) ) { |
||
78 | $nodes = $this->getCells( $list, 'td' ); |
||
79 | $foot = $this->tfoot->lastChild; |
||
0 ignored issues
–
show
The property
tfoot does not exist on object<ar_html_table> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
80 | if ( !isset($foot) ) { |
||
81 | $foot = ar_html::tag( 'tfoot', $attributes ); |
||
82 | if ( $head = $this->thead->lastChild ) { |
||
0 ignored issues
–
show
The property
thead does not exist on object<ar_html_table> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
83 | $this->insertBefore( $foot, $head->nextSibling ); |
||
84 | } else if ( $body = $this->tbody->firstChild ) { |
||
0 ignored issues
–
show
The property
tbody does not exist on object<ar_html_table> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
85 | $this->insertBefore( $foot, $body ); |
||
86 | } else { |
||
87 | $this->appendChild( $foot ); |
||
88 | } |
||
89 | } else if (isset( $attributes ) ) { |
||
90 | $foot->setAttributes( $attributes ); |
||
91 | } |
||
92 | $foot->appendChild( ar_html::tag( 'tr', $nodes ) ); |
||
93 | } |
||
94 | return $this; |
||
95 | } |
||
96 | |||
97 | public function rowHeaders( $list, $attributes = array() ) { |
||
98 | foreach ( $list as $key => $value ) { |
||
99 | if ( ! ($value instanceof ar_htmlNode ) || $value->tagName != 'th' ) { |
||
0 ignored issues
–
show
The property
tagName does not exist on object<ar_htmlNode> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
100 | $list[$key] = ar_html::tag( 'th', |
||
101 | array_merge( |
||
102 | (array) $attributes, |
||
103 | array( 'scope' => 'row' ) |
||
104 | ), |
||
105 | $value |
||
106 | ); |
||
107 | } |
||
108 | } |
||
109 | reset($list); |
||
110 | foreach( $this->tbody->lastChild->childNodes as $row ) { |
||
0 ignored issues
–
show
The property
tbody does not exist on object<ar_html_table> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
111 | $row->insertBefore( current($list), $row->firstChild ); |
||
112 | next($list); |
||
113 | } |
||
114 | $this->rowHeaders = $list; |
||
115 | $this->rowHeaderAttributes = $attributes; |
||
116 | return $this; |
||
117 | } |
||
118 | |||
119 | public function cols() { |
||
120 | $args = func_get_args(); |
||
121 | $cols = call_user_func_array( array('ar_html', 'nodes'), $args ); |
||
122 | $this->removeChild( $this->colgroup ); |
||
0 ignored issues
–
show
The property
colgroup does not exist on object<ar_html_table> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
123 | $this->removeChild( $this->col ); |
||
0 ignored issues
–
show
The property
col does not exist on object<ar_html_table> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
124 | $this->insertBefore( $cols, $this->firstChild ); |
||
0 ignored issues
–
show
The property
firstChild does not exist on object<ar_html_table> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
125 | return $this; |
||
126 | } |
||
127 | |||
128 | public function caption($content, $attributes = null) { |
||
129 | $newCaption = ar_html::tag( 'caption', $content, $attributes ); |
||
130 | if ( $caption = $this->caption->firstChild ) { |
||
0 ignored issues
–
show
The property
caption does not exist on object<ar_html_table> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
131 | $this->replaceChild( $newCaption, $caption ); |
||
132 | } else { |
||
133 | $this->insertBefore( $newCaption, $this->firstChild ); |
||
0 ignored issues
–
show
The property
firstChild does not exist on object<ar_html_table> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
134 | } |
||
135 | return $this; |
||
136 | } |
||
137 | } |
||
138 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.