1 | <?php |
||
30 | class UserInfo implements UserInfoInterface |
||
31 | { |
||
32 | use ImmutablePropertyTrait; |
||
33 | use ValidatorTrait; |
||
34 | |||
35 | /** |
||
36 | * User Component |
||
37 | * |
||
38 | * @var User |
||
39 | */ |
||
40 | protected $user; |
||
41 | |||
42 | /** |
||
43 | * Pass Component |
||
44 | * |
||
45 | * @var Pass |
||
46 | */ |
||
47 | protected $pass; |
||
48 | |||
49 | /** |
||
50 | * Create a new instance of UserInfo |
||
51 | * |
||
52 | * @param UserInterface|string $user |
||
53 | * @param PassInterface|string $pass |
||
54 | */ |
||
55 | 817 | public function __construct($user = null, $pass = null) |
|
61 | |||
62 | /** |
||
63 | * Retrieve the user component of the URI User Info part |
||
64 | * |
||
65 | * @return string |
||
66 | */ |
||
67 | 276 | public function getUser() |
|
71 | |||
72 | /** |
||
73 | * Retrieve the pass component of the URI User Info part |
||
74 | * |
||
75 | * @return string |
||
76 | */ |
||
77 | 270 | public function getPass() |
|
81 | |||
82 | /** |
||
83 | * @inheritdoc |
||
84 | */ |
||
85 | 2 | public function __debugInfo() |
|
89 | |||
90 | /** |
||
91 | * @inheritdoc |
||
92 | */ |
||
93 | 12 | public static function __set_state(array $properties) |
|
97 | |||
98 | /** |
||
99 | * Returns the component literal value. |
||
100 | * |
||
101 | * @return null|string |
||
102 | */ |
||
103 | 829 | public function getContent() |
|
117 | |||
118 | /** |
||
119 | * Returns the instance string representation; If the |
||
120 | * instance is not defined an empty string is returned |
||
121 | * |
||
122 | * @return string |
||
123 | */ |
||
124 | 823 | public function __toString() |
|
128 | |||
129 | /** |
||
130 | * Returns the instance string representation |
||
131 | * with its optional URI delimiters |
||
132 | * |
||
133 | * @return string |
||
134 | */ |
||
135 | 788 | public function getUriComponent() |
|
144 | |||
145 | /** |
||
146 | * DEPRECATION WARNING! This method will be removed in the next major point release |
||
147 | * |
||
148 | * @deprecated deprecated since version 4.2 |
||
149 | * |
||
150 | * Returns whether two UriPart objects represent the same value |
||
151 | * The comparison is based on the getUriComponent method |
||
152 | * |
||
153 | * @param UriPart $component |
||
154 | * |
||
155 | * @return bool |
||
156 | */ |
||
157 | public function sameValueAs(UriPart $component) |
||
161 | |||
162 | /** |
||
163 | * Return an instance with the specified user. |
||
164 | * |
||
165 | * This method MUST retain the state of the current instance, and return |
||
166 | * an instance that contains the specified user. |
||
167 | * |
||
168 | * An empty user is equivalent to removing the user information. |
||
169 | * |
||
170 | * @param string $user The user to use with the new instance. |
||
171 | * |
||
172 | * @throws \InvalidArgumentException for invalid user. |
||
173 | * |
||
174 | * @return static |
||
175 | */ |
||
176 | 243 | public function withUser($user) |
|
180 | |||
181 | /** |
||
182 | * Return an instance with the specified password. |
||
183 | * |
||
184 | * This method MUST retain the state of the current instance, and return |
||
185 | * an instance that contains the specified password. |
||
186 | * |
||
187 | * An empty password is equivalent to removing the password. |
||
188 | * |
||
189 | * @param string $pass The password to use with the new instance. |
||
190 | * |
||
191 | * @throws \InvalidArgumentException for invalid password. |
||
192 | * |
||
193 | * @return static |
||
194 | */ |
||
195 | 243 | public function withPass($pass) |
|
199 | |||
200 | /** |
||
201 | * Create a new instance from a string |
||
202 | * |
||
203 | * @param string $str |
||
204 | * |
||
205 | * @return static |
||
206 | */ |
||
207 | 21 | public function withContent($content = null) |
|
228 | |||
229 | /** |
||
230 | * @inheritdoc |
||
231 | */ |
||
232 | 817 | protected function assertValidObject() |
|
235 | } |
||
236 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.