1 | <?php |
||
9 | class DbCredentials implements RegistrationInterface |
||
10 | { |
||
11 | /** @var array */ |
||
12 | private $credentials; |
||
13 | |||
14 | 11 | public function __construct(array $array = null) |
|
15 | { |
||
16 | 11 | $this->credentials = []; |
|
17 | 11 | $this->credentials['driver'] = $array['driver']; |
|
18 | 11 | $this->credentials['dbname'] = $array['dbname']; |
|
19 | 11 | $this->credentials['user'] = $array['user']; |
|
20 | 11 | $this->credentials['password'] = $array['password']; |
|
21 | 11 | $this->credentials['host'] = $array['host'] ?: '127.0.0.1'; |
|
22 | 11 | } |
|
23 | |||
24 | /** |
||
25 | * @return string |
||
26 | */ |
||
27 | 1 | public function getPassword() |
|
31 | |||
32 | /** |
||
33 | * @param string $password |
||
34 | * @return DbCredentials |
||
35 | */ |
||
36 | 11 | public function setPassword($password) |
|
41 | |||
42 | /** |
||
43 | * @return string |
||
44 | */ |
||
45 | 1 | public function getUser() |
|
49 | |||
50 | /** |
||
51 | * @param string $user |
||
52 | * @return DbCredentials |
||
53 | */ |
||
54 | 12 | public function setUser($user) |
|
59 | |||
60 | /** |
||
61 | * @return string |
||
62 | */ |
||
63 | 1 | public function getDatabase() |
|
67 | |||
68 | /** |
||
69 | * @param string $database |
||
70 | * @return DbCredentials |
||
71 | */ |
||
72 | 11 | public function setDatabase($database) |
|
77 | |||
78 | /** |
||
79 | * @return string |
||
80 | */ |
||
81 | 1 | public function getHost() |
|
82 | { |
||
83 | 1 | return $this->credentials['host']; |
|
84 | } |
||
85 | |||
86 | /** |
||
87 | * @param string $database |
||
|
|||
88 | * @return DbCredentials |
||
89 | */ |
||
90 | 9 | public function setHost($host) |
|
91 | { |
||
92 | 9 | $this->credentials['host'] = $host; |
|
93 | 9 | return $this; |
|
94 | } |
||
95 | |||
96 | /** |
||
97 | * @return string |
||
98 | */ |
||
99 | 1 | public function getDriver() |
|
103 | |||
104 | /** |
||
105 | * @param string $driver |
||
106 | * @return DbCredentials |
||
107 | */ |
||
108 | 11 | public function setDriver($driver) |
|
113 | |||
114 | /** |
||
115 | * @return array |
||
116 | */ |
||
117 | 9 | public function toArray() |
|
121 | |||
122 | /** |
||
123 | * @param Container $c |
||
124 | * @return Container |
||
125 | */ |
||
126 | 1 | public function addToContainer(Container $c) |
|
131 | |||
132 | /** |
||
133 | * @return null |
||
134 | */ |
||
135 | 1 | public function getEntityPath() |
|
139 | |||
140 | /** |
||
141 | * @return bool |
||
142 | */ |
||
143 | 2 | public function hasEntityPath() |
|
147 | } |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.