Issues (1377)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

API/Chart/HighchartsNoData.php (6 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/**
4
 * This file is part of the highcharts-bundle package.
5
 *
6
 * (c) 2017 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\HighchartsBundle\API\Chart;
13
14
use JsonSerializable;
15
use WBW\Library\Core\Utility\Argument\ArrayUtility;
16
17
/**
18
 * Highcharts no data.
19
 *
20
 * @author webeweb <https://github.com/webeweb/>
21
 * @package WBW\Bundle\HighchartsBundle\API\Chart
22
 * @version 5.0.14
23
 * @final
24
 */
25
final class HighchartsNoData implements JsonSerializable {
26
27
    /**
28
     * Attr.
29
     *
30
     * @var array
31
     * @since 3.0.8
32
     */
33
    private $attr;
34
35
    /**
36
     * Position.
37
     *
38
     * @var array
39
     * @since 3.0.8
40
     */
41
    private $position = ["x" => 0, "y" => 0, "align" => "center", "verticalAlign" => "middle"];
42
43
    /**
44
     * Style.
45
     *
46
     * @var array
47
     * @since 3.0.8
48
     */
49
    private $style = ["fontSize" => "12px", "fontWeight" => "bold", "color" => "#666666"];
50
51
    /**
52
     * Use HTML.
53
     *
54
     * @var boolean
55
     * @since 4.1.10
56
     */
57
    private $useHTML = false;
58
59
    /**
60
     * Constructor.
61
     *
62
     * @param boolean $ignoreDefaultValues Ignore the default values.
63
     */
64
    public function __construct($ignoreDefaultValues = true) {
65
        if (true === $ignoreDefaultValues) {
66
            $this->clear();
67
        }
68
    }
69
70
    /**
71
     * Clear.
72
     *
73
     * @return void
74
     */
75
    public function clear() {
76
77
        // Clear the attr.
78
        $this->attr = null;
0 ignored issues
show
Documentation Bug introduced by
It seems like null of type null is incompatible with the declared type array of property $attr.

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..

Loading history...
79
80
        // Clear the position.
81
        $this->position = null;
0 ignored issues
show
Documentation Bug introduced by
It seems like null of type null is incompatible with the declared type array of property $position.

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..

Loading history...
82
83
        // Clear the style.
84
        $this->style = null;
0 ignored issues
show
Documentation Bug introduced by
It seems like null of type null is incompatible with the declared type array of property $style.

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..

Loading history...
85
86
        // Clear the use HTML.
87
        $this->useHTML = null;
88
    }
89
90
    /**
91
     * Get the attr.
92
     *
93
     * @return array Returns the attr.
94
     */
95
    public function getAttr() {
96
        return $this->attr;
97
    }
98
99
    /**
100
     * Get the position.
101
     *
102
     * @return array Returns the position.
103
     */
104
    public function getPosition() {
105
        return $this->position;
106
    }
107
108
    /**
109
     * Get the style.
110
     *
111
     * @return array Returns the style.
112
     */
113
    public function getStyle() {
114
        return $this->style;
115
    }
116
117
    /**
118
     * Get the use HTML.
119
     *
120
     * @return boolean Returns the use HTML.
121
     */
122
    public function getUseHTML() {
123
        return $this->useHTML;
124
    }
125
126
    /**
127
     * Serialize this instance.
128
     *
129
     * @return array Returns an array representing this instance.
130
     */
131
    public function jsonSerialize() {
132
        return $this->toArray();
133
    }
134
135
    /**
136
     * Set the attr.
137
     *
138
     * @param array $attr The attr.
139
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsNoData Returns the highcharts no data.
140
     */
141
    public function setAttr(array $attr = null) {
142
        $this->attr = $attr;
0 ignored issues
show
Documentation Bug introduced by
It seems like $attr can be null. However, the property $attr is declared as array. Maybe change the type of the property to array|null or add a type check?

Our type inference engine has found an assignment of a scalar value (like a string, an integer or null) to a property which is an array.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property.

To type hint that a parameter can be either an array or null, you can set a type hint of array and a default value of null. The PHP interpreter will then accept both an array or null for that parameter.

function aContainsB(array $needle = null, array  $haystack) {
    if (!$needle) {
        return false;
    }

    return array_intersect($haystack, $needle) == $haystack;
}

The function can be called with either null or an array for the parameter $needle but will only accept an array as $haystack.

Loading history...
143
        return $this;
144
    }
145
146
    /**
147
     * Set the position.
148
     *
149
     * @param array $position The position.
150
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsNoData Returns the highcharts no data.
151
     */
152
    public function setPosition(array $position = null) {
153
        $this->position = $position;
0 ignored issues
show
Documentation Bug introduced by
It seems like $position can be null. However, the property $position is declared as array. Maybe change the type of the property to array|null or add a type check?

Our type inference engine has found an assignment of a scalar value (like a string, an integer or null) to a property which is an array.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property.

To type hint that a parameter can be either an array or null, you can set a type hint of array and a default value of null. The PHP interpreter will then accept both an array or null for that parameter.

function aContainsB(array $needle = null, array  $haystack) {
    if (!$needle) {
        return false;
    }

    return array_intersect($haystack, $needle) == $haystack;
}

The function can be called with either null or an array for the parameter $needle but will only accept an array as $haystack.

Loading history...
154
        return $this;
155
    }
156
157
    /**
158
     * Set the style.
159
     *
160
     * @param array $style The style.
161
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsNoData Returns the highcharts no data.
162
     */
163
    public function setStyle(array $style = null) {
164
        $this->style = $style;
0 ignored issues
show
Documentation Bug introduced by
It seems like $style can be null. However, the property $style is declared as array. Maybe change the type of the property to array|null or add a type check?

Our type inference engine has found an assignment of a scalar value (like a string, an integer or null) to a property which is an array.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property.

To type hint that a parameter can be either an array or null, you can set a type hint of array and a default value of null. The PHP interpreter will then accept both an array or null for that parameter.

function aContainsB(array $needle = null, array  $haystack) {
    if (!$needle) {
        return false;
    }

    return array_intersect($haystack, $needle) == $haystack;
}

The function can be called with either null or an array for the parameter $needle but will only accept an array as $haystack.

Loading history...
165
        return $this;
166
    }
167
168
    /**
169
     * Set the use HTML.
170
     *
171
     * @param boolean $useHTML The use HTML.
172
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsNoData Returns the highcharts no data.
173
     */
174
    public function setUseHTML($useHTML) {
175
        $this->useHTML = $useHTML;
176
        return $this;
177
    }
178
179
    /**
180
     * Convert into an array representing this instance.
181
     *
182
     * @return array Returns an array representing this instance.
183
     */
184
    public function toArray() {
185
186
        // Initialize the output.
187
        $output = [];
188
189
        // Set the attr.
190
        ArrayUtility::set($output, "attr", $this->attr, [null]);
191
192
        // Set the position.
193
        ArrayUtility::set($output, "position", $this->position, [null]);
194
195
        // Set the style.
196
        ArrayUtility::set($output, "style", $this->style, [null]);
197
198
        // Set the use HTML.
199
        ArrayUtility::set($output, "useHTML", $this->useHTML, [null]);
200
201
        // Return the output.
202
        return $output;
203
    }
204
205
}
206