1 | <?php |
||
9 | class UserLoader |
||
10 | { |
||
11 | /** |
||
12 | * @var bool |
||
13 | */ |
||
14 | private $enableConnector ; |
||
15 | /** |
||
16 | * @var SkautisUserConnectorInterface |
||
17 | */ |
||
18 | private $userConnector; |
||
19 | |||
20 | /** |
||
21 | * @var bool |
||
22 | */ |
||
23 | private $enableAutoRegister; |
||
24 | |||
25 | /** |
||
26 | * @var UserRegistratorInterface |
||
27 | */ |
||
28 | private $userRegistrator; |
||
29 | |||
30 | /** |
||
31 | * UserLoader constructor. |
||
32 | * @param bool $enableConnector |
||
33 | * @param SkautisUserConnectorInterface $userConnector |
||
34 | * @param bool $enableAutoRegister |
||
35 | * @param UserRegistratorInterface $userRegistrator |
||
36 | */ |
||
37 | public function __construct($enableConnector = false, SkautisUserConnectorInterface $userConnector = null, $enableAutoRegister = false, UserRegistratorInterface $userRegistrator = null) |
||
44 | |||
45 | |||
46 | public function loadUser($personId, $userProvider) |
||
76 | } |
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.