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/HighchartsNavigation.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 navigation.
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 HighchartsNavigation implements JsonSerializable {
26
27
    /**
28
     * Button options.
29
     *
30
     * @var \WBW\Bundle\HighchartsBundle\API\Chart\Navigation\HighchartsButtonOptions
31
     */
32
    private $buttonOptions;
33
34
    /**
35
     * Menu item hover style.
36
     *
37
     * @var array
38
     * @since 2.0
39
     */
40
    private $menuItemHoverStyle = ["background" => "#335cad", "color" => "#ffffff"];
41
42
    /**
43
     * Menu item style.
44
     *
45
     * @var array
46
     * @since 2.0
47
     */
48
    private $menuItemStyle = ["padding" => "0.5em 1em", "color" => "#333333", "background" => "none"];
49
50
    /**
51
     * Menu style.
52
     *
53
     * @var array
54
     * @since 2.0
55
     */
56
    private $menuStyle = ["border" => "1px solid #999999", "background" => "#ffffff", "padding" => "5px 0"];
57
58
    /**
59
     * Constructor.
60
     *
61
     * @param boolean $ignoreDefaultValues Ignore the default values.
62
     */
63
    public function __construct($ignoreDefaultValues = true) {
64
        if (true === $ignoreDefaultValues) {
65
            $this->clear();
66
        }
67
    }
68
69
    /**
70
     * Clear.
71
     *
72
     * @return void
73
     */
74
    public function clear() {
75
76
        // Clear the button options.
77
        if (null !== $this->buttonOptions) {
78
            $this->buttonOptions->clear();
79
        }
80
81
        // Clear the menu item hover style.
82
        $this->menuItemHoverStyle = 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 $menuItemHoverStyle.

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...
83
84
        // Clear the menu item style.
85
        $this->menuItemStyle = 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 $menuItemStyle.

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...
86
87
        // Clear the menu style.
88
        $this->menuStyle = 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 $menuStyle.

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...
89
    }
90
91
    /**
92
     * Get the button options.
93
     *
94
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\Navigation\HighchartsButtonOptions Returns the button options.
95
     */
96
    public function getButtonOptions() {
97
        return $this->buttonOptions;
98
    }
99
100
    /**
101
     * Get the menu item hover style.
102
     *
103
     * @return array Returns the menu item hover style.
104
     */
105
    public function getMenuItemHoverStyle() {
106
        return $this->menuItemHoverStyle;
107
    }
108
109
    /**
110
     * Get the menu item style.
111
     *
112
     * @return array Returns the menu item style.
113
     */
114
    public function getMenuItemStyle() {
115
        return $this->menuItemStyle;
116
    }
117
118
    /**
119
     * Get the menu style.
120
     *
121
     * @return array Returns the menu style.
122
     */
123
    public function getMenuStyle() {
124
        return $this->menuStyle;
125
    }
126
127
    /**
128
     * Serialize this instance.
129
     *
130
     * @return array Returns an array representing this instance.
131
     */
132
    public function jsonSerialize() {
133
        return $this->toArray();
134
    }
135
136
    /**
137
     * Create a new button options.
138
     *
139
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\Navigation\HighchartsButtonOptions Returns the button options.
140
     */
141
    public function newButtonOptions() {
142
        $this->buttonOptions = new \WBW\Bundle\HighchartsBundle\API\Chart\Navigation\HighchartsButtonOptions();
143
        return $this->buttonOptions;
144
    }
145
146
    /**
147
     * Set the button options.
148
     *
149
     * @param \WBW\Bundle\HighchartsBundle\API\Chart\Navigation\HighchartsButtonOptions $buttonOptions The button options.
150
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsNavigation Returns the highcharts navigation.
151
     */
152
    public function setButtonOptions(\WBW\Bundle\HighchartsBundle\API\Chart\Navigation\HighchartsButtonOptions $buttonOptions = null) {
153
        $this->buttonOptions = $buttonOptions;
154
        return $this;
155
    }
156
157
    /**
158
     * Set the menu item hover style.
159
     *
160
     * @param array $menuItemHoverStyle The menu item hover style.
161
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsNavigation Returns the highcharts navigation.
162
     */
163
    public function setMenuItemHoverStyle(array $menuItemHoverStyle = null) {
164
        $this->menuItemHoverStyle = $menuItemHoverStyle;
0 ignored issues
show
Documentation Bug introduced by
It seems like $menuItemHoverStyle can be null. However, the property $menuItemHoverStyle 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 menu item style.
170
     *
171
     * @param array $menuItemStyle The menu item style.
172
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsNavigation Returns the highcharts navigation.
173
     */
174
    public function setMenuItemStyle(array $menuItemStyle = null) {
175
        $this->menuItemStyle = $menuItemStyle;
0 ignored issues
show
Documentation Bug introduced by
It seems like $menuItemStyle can be null. However, the property $menuItemStyle 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...
176
        return $this;
177
    }
178
179
    /**
180
     * Set the menu style.
181
     *
182
     * @param array $menuStyle The menu style.
183
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsNavigation Returns the highcharts navigation.
184
     */
185
    public function setMenuStyle(array $menuStyle = null) {
186
        $this->menuStyle = $menuStyle;
0 ignored issues
show
Documentation Bug introduced by
It seems like $menuStyle can be null. However, the property $menuStyle 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...
187
        return $this;
188
    }
189
190
    /**
191
     * Convert into an array representing this instance.
192
     *
193
     * @return array Returns an array representing this instance.
194
     */
195
    public function toArray() {
196
197
        // Initialize the output.
198
        $output = [];
199
200
        // Set the button options.
201
        if (null !== $this->buttonOptions) {
202
            ArrayUtility::set($output, "buttonOptions", $this->buttonOptions->toArray(), []);
203
        }
204
205
        // Set the menu item hover style.
206
        ArrayUtility::set($output, "menuItemHoverStyle", $this->menuItemHoverStyle, [null]);
207
208
        // Set the menu item style.
209
        ArrayUtility::set($output, "menuItemStyle", $this->menuItemStyle, [null]);
210
211
        // Set the menu style.
212
        ArrayUtility::set($output, "menuStyle", $this->menuStyle, [null]);
213
214
        // Return the output.
215
        return $output;
216
    }
217
218
}
219