1 | <?php |
||
11 | class BasicAuthentication implements IAuthentication |
||
12 | { |
||
13 | |||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private $user; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $password; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $key; |
||
28 | |||
29 | /** |
||
30 | * BasicAuthentication constructor. |
||
31 | * |
||
32 | * @param string $user |
||
33 | * @param string $password |
||
34 | */ |
||
35 | public function __construct($user, $password, $key = null) |
||
41 | |||
42 | /** |
||
43 | * @return string |
||
44 | * @throws \Exception |
||
45 | */ |
||
46 | public function getAuthorization() |
||
55 | |||
56 | /** |
||
57 | * @return string |
||
58 | */ |
||
59 | public function getUser() |
||
63 | |||
64 | /** |
||
65 | * @param string $user |
||
66 | * @return BasicAuthentication |
||
67 | */ |
||
68 | public function setUser($user) |
||
73 | |||
74 | /** |
||
75 | * @return string |
||
76 | */ |
||
77 | public function getPassword() |
||
81 | |||
82 | /** |
||
83 | * @param string $password |
||
84 | * @return BasicAuthentication |
||
85 | */ |
||
86 | public function setPassword($password) |
||
91 | |||
92 | } |
This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.
Unreachable code is most often the result of
return
,die
orexit
statements that have been added for debug purposes.In the above example, the last
return false
will never be executed, because a return statement has already been met in every possible execution path.