webeweb /
highcharts-bundle
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 | /** |
||
| 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 loading. |
||
| 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 HighchartsLoading implements JsonSerializable { |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Hide duration. |
||
| 29 | * |
||
| 30 | * @var integer |
||
| 31 | * @since 1.2.0 |
||
| 32 | */ |
||
| 33 | private $hideDuration = 100; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Label style. |
||
| 37 | * |
||
| 38 | * @var array |
||
| 39 | * @since 1.2.0 |
||
| 40 | */ |
||
| 41 | private $labelStyle = ["fontWeight" => "bold", "position" => "relative", "top" => "45%"]; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Show duration. |
||
| 45 | * |
||
| 46 | * @var integer |
||
| 47 | * @since 1.2.0 |
||
| 48 | */ |
||
| 49 | private $showDuration = 100; |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Style. |
||
| 53 | * |
||
| 54 | * @var array |
||
| 55 | * @since 1.2.0 |
||
| 56 | */ |
||
| 57 | private $style = ["position" => "absolute", "backgroundColor" => "#ffffff", "opacity" => 0.5, "textAlign" => "center"]; |
||
| 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 hide duration. |
||
| 78 | $this->hideDuration = null; |
||
| 79 | |||
| 80 | // Clear the label style. |
||
| 81 | $this->labelStyle = null; |
||
|
0 ignored issues
–
show
|
|||
| 82 | |||
| 83 | // Clear the show duration. |
||
| 84 | $this->showDuration = null; |
||
| 85 | |||
| 86 | // Clear the style. |
||
| 87 | $this->style = null; |
||
|
0 ignored issues
–
show
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...
|
|||
| 88 | } |
||
| 89 | |||
| 90 | /** |
||
| 91 | * Get the hide duration. |
||
| 92 | * |
||
| 93 | * @return integer Returns the hide duration. |
||
| 94 | */ |
||
| 95 | public function getHideDuration() { |
||
| 96 | return $this->hideDuration; |
||
| 97 | } |
||
| 98 | |||
| 99 | /** |
||
| 100 | * Get the label style. |
||
| 101 | * |
||
| 102 | * @return array Returns the label style. |
||
| 103 | */ |
||
| 104 | public function getLabelStyle() { |
||
| 105 | return $this->labelStyle; |
||
| 106 | } |
||
| 107 | |||
| 108 | /** |
||
| 109 | * Get the show duration. |
||
| 110 | * |
||
| 111 | * @return integer Returns the show duration. |
||
| 112 | */ |
||
| 113 | public function getShowDuration() { |
||
| 114 | return $this->showDuration; |
||
| 115 | } |
||
| 116 | |||
| 117 | /** |
||
| 118 | * Get the style. |
||
| 119 | * |
||
| 120 | * @return array Returns the style. |
||
| 121 | */ |
||
| 122 | public function getStyle() { |
||
| 123 | return $this->style; |
||
| 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 hide duration. |
||
| 137 | * |
||
| 138 | * @param integer $hideDuration The hide duration. |
||
| 139 | * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsLoading Returns the highcharts loading. |
||
| 140 | */ |
||
| 141 | public function setHideDuration($hideDuration) { |
||
| 142 | $this->hideDuration = $hideDuration; |
||
| 143 | return $this; |
||
| 144 | } |
||
| 145 | |||
| 146 | /** |
||
| 147 | * Set the label style. |
||
| 148 | * |
||
| 149 | * @param array $labelStyle The label style. |
||
| 150 | * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsLoading Returns the highcharts loading. |
||
| 151 | */ |
||
| 152 | public function setLabelStyle(array $labelStyle = null) { |
||
| 153 | $this->labelStyle = $labelStyle; |
||
|
0 ignored issues
–
show
It seems like
$labelStyle can be null. However, the property $labelStyle 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 Loading history...
|
|||
| 154 | return $this; |
||
| 155 | } |
||
| 156 | |||
| 157 | /** |
||
| 158 | * Set the show duration. |
||
| 159 | * |
||
| 160 | * @param integer $showDuration The show duration. |
||
| 161 | * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsLoading Returns the highcharts loading. |
||
| 162 | */ |
||
| 163 | public function setShowDuration($showDuration) { |
||
| 164 | $this->showDuration = $showDuration; |
||
| 165 | return $this; |
||
| 166 | } |
||
| 167 | |||
| 168 | /** |
||
| 169 | * Set the style. |
||
| 170 | * |
||
| 171 | * @param array $style The style. |
||
| 172 | * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsLoading Returns the highcharts loading. |
||
| 173 | */ |
||
| 174 | public function setStyle(array $style = null) { |
||
| 175 | $this->style = $style; |
||
|
0 ignored issues
–
show
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 Loading history...
|
|||
| 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 hide duration. |
||
| 190 | ArrayUtility::set($output, "hideDuration", $this->hideDuration, [null]); |
||
| 191 | |||
| 192 | // Set the label style. |
||
| 193 | ArrayUtility::set($output, "labelStyle", $this->labelStyle, [null]); |
||
| 194 | |||
| 195 | // Set the show duration. |
||
| 196 | ArrayUtility::set($output, "showDuration", $this->showDuration, [null]); |
||
| 197 | |||
| 198 | // Set the style. |
||
| 199 | ArrayUtility::set($output, "style", $this->style, [null]); |
||
| 200 | |||
| 201 | // Return the output. |
||
| 202 | return $output; |
||
| 203 | } |
||
| 204 | |||
| 205 | } |
||
| 206 |
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..