| Total Complexity | 5 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 13 | class Context |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @param string $name |
||
| 17 | * @param $value |
||
| 18 | */ |
||
| 19 | public static function set(string $name, $value): void |
||
| 20 | { |
||
| 21 | /** @var \ArrayObject $context */ |
||
| 22 | $context = Co::getContext(); |
||
|
|
|||
| 23 | $context[$name] = $value; |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param string $name |
||
| 28 | * @return mixed |
||
| 29 | */ |
||
| 30 | public static function get(string $name) |
||
| 31 | { |
||
| 32 | /** @var \ArrayObject $context */ |
||
| 33 | $context = Co::getContext(); |
||
| 34 | return isset($context[$name]) ? $context[$name] : null; |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @param string $name |
||
| 39 | * @return bool |
||
| 40 | */ |
||
| 41 | public static function has(string $name): bool |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @param string $name |
||
| 50 | */ |
||
| 51 | public static function delete(string $name): void |
||
| 56 | } |
||
| 57 | } |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.