1 | <?php namespace Xoopsmodules\instruction; |
||
15 | class Utility |
||
16 | { |
||
17 | use common\VersionChecks; //checkVerXoops, checkVerPhp Traits |
||
18 | |||
19 | use common\ServerStats; // getServerStats Trait |
||
20 | |||
21 | use common\FilesManagement; // Files Management Trait |
||
22 | |||
23 | // Права |
||
24 | /** |
||
25 | * @param string $permtype |
||
26 | * @return mixed |
||
27 | */ |
||
28 | public static function getItemIds($permtype = 'instruction_view') |
||
45 | |||
46 | // Редактор |
||
47 | |||
48 | /** |
||
49 | * @param $caption |
||
50 | * @param $name |
||
51 | * @param string $value |
||
52 | * @return bool|\XoopsFormEditor |
||
53 | */ |
||
54 | public static function getWysiwygForm($caption, $name, $value = '') |
||
69 | |||
70 | // Получение значения переменной, переданной через GET или POST запрос |
||
71 | |||
72 | /** |
||
73 | * @param $global |
||
74 | * @param $key |
||
75 | * @param string $default |
||
76 | * @param string $type |
||
77 | * @return int|string |
||
78 | */ |
||
79 | public static function cleanVars(&$global, $key, $default = '', $type = 'int') |
||
95 | } |
||
96 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.