1 | <?php |
||
5 | class Pasteboard |
||
6 | { |
||
7 | private static $clipboard = "foo"; |
||
8 | private static $process; |
||
9 | private static $pipes; |
||
10 | |||
11 | /** |
||
12 | * @param $value |
||
13 | * @return bool|string |
||
14 | */ |
||
15 | 9 | public static function set($value) |
|
19 | |||
20 | /** |
||
21 | * @return bool|string |
||
22 | */ |
||
23 | 9 | public static function get() |
|
27 | |||
28 | /** |
||
29 | * @param $array |
||
30 | * @param array $options |
||
31 | * @return bool |
||
32 | */ |
||
33 | 5 | public static function setArray($array, $options = array()) |
|
46 | |||
47 | /** |
||
48 | * @param $action |
||
49 | * @param null $value |
||
50 | * @return bool|string |
||
51 | */ |
||
52 | 9 | private static function action($action, $value = null) |
|
62 | |||
63 | /** |
||
64 | * @param $process |
||
65 | * @return bool |
||
66 | */ |
||
67 | 9 | private static function openProcess($process) |
|
85 | |||
86 | /** |
||
87 | * @return int |
||
88 | */ |
||
89 | 9 | private static function closeProcess() |
|
97 | |||
98 | /** |
||
99 | * @param $action |
||
100 | * @param $value |
||
101 | * @return bool|string |
||
102 | */ |
||
103 | 9 | private static function doAction($action, $value) |
|
120 | |||
121 | /** |
||
122 | * @param string $do |
||
123 | * @param bool $test |
||
124 | */ |
||
125 | 5 | private static function storedClipboard($do, $test = true) |
|
131 | |||
132 | /** |
||
133 | * @param $options |
||
134 | * @return mixed |
||
135 | */ |
||
136 | 5 | private static function configureArray($options) |
|
145 | |||
146 | /** |
||
147 | * @param $wait |
||
148 | * @return \Closure |
||
149 | */ |
||
150 | private static function defaultHeartbeat($wait) |
||
162 | |||
163 | /** |
||
164 | * @param string $name |
||
165 | * @param $default |
||
166 | * @param $requested |
||
167 | * @return mixed |
||
168 | */ |
||
169 | 5 | private static function setOption($name, $default, $requested) |
|
177 | |||
178 | /** |
||
179 | * @param $value |
||
180 | * @param $config |
||
181 | * @return bool |
||
182 | */ |
||
183 | 5 | private static function setArrayValue($value, $config) |
|
198 | } |
||
199 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.
For example, imagine you have a variable
$accountId
that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to theid
property of an instance of theAccount
class. This class holds a proper account, so the id value must no longer be false.Either this assignment is in error or a type check should be added for that assignment.