@@ -49,8 +49,8 @@ class Ldap extends UserPassBase
4949 /**
5050 * Constructor for this authentication source.
5151 *
52- * @param array $info Information about this authentication source.
53- * @param array $config Configuration.
52+ * @param array<mixed> $info Information about this authentication source.
53+ * @param array<mixed> $config Configuration.
5454 */
5555 public function __construct (array $ info , array $ config )
5656 {
@@ -71,11 +71,15 @@ public function __construct(array $info, array $config)
7171 *
7272 * @param string $username The username the user wrote.
7373 * @param string $password The password the user wrote.
74- * @param array|null $sasl_args SASL options
75- * @return array Associative array with the users attributes.
74+ * @param array<mixed> $sasl_args SASL options
75+ * @return array<mixed> Associative array with the users attributes.
7676 */
77- protected function loginSasl (string $ username , #[\SensitiveParameter]string $ password , array $ sasl_args = []): array
78- {
77+ protected function loginSasl (
78+ string $ username ,
79+ #[\SensitiveParameter]
80+ string $ password ,
81+ array $ sasl_args = [],
82+ ): array {
7983 if (preg_match ('/^\s*$/ ' , $ password )) {
8084 // The empty string is considered an anonymous bind to Symfony
8185 throw new Error \Error ('WRONGUSERPASS ' );
@@ -110,7 +114,7 @@ protected function loginSasl(string $username, #[\SensitiveParameter]string $pas
110114 Assert::nullOrNotWhitespaceOnly ($ searchUsername );
111115
112116 $ searchPassword = $ this ->ldapConfig ->getOptionalString ('search.password ' , null );
113- Assert::nullOrnotWhitespaceOnly ($ searchPassword );
117+ Assert::nullOrNotWhitespaceOnly ($ searchPassword );
114118
115119 try {
116120 $ this ->connector ->bind ($ searchUsername , $ searchPassword );
@@ -164,7 +168,7 @@ protected function loginSasl(string $username, #[\SensitiveParameter]string $pas
164168 *
165169 * @param string $username The username the user wrote.
166170 * @param string $password The password the user wrote.
167- * @return array Associative array with the users attributes.
171+ * @return array<mixed> Associative array with the users attributes.
168172 */
169173 protected function login (string $ username , #[\SensitiveParameter]string $ password ): array
170174 {
@@ -176,15 +180,15 @@ protected function login(string $username, #[\SensitiveParameter]string $passwor
176180 * Attempt to find a user's attributes given its username.
177181 *
178182 * @param string $username The username who's attributes we want.
179- * @return array Associative array with the users attributes.
183+ * @return array<mixed> Associative array with the users attributes.
180184 */
181185 public function getAttributes (string $ username ): array
182186 {
183187 $ searchUsername = $ this ->ldapConfig ->getOptionalString ('search.username ' , null );
184188 Assert::nullOrNotWhitespaceOnly ($ searchUsername );
185189
186190 $ searchPassword = $ this ->ldapConfig ->getOptionalString ('search.password ' , null );
187- Assert::nullOrnotWhitespaceOnly ($ searchPassword );
191+ Assert::nullOrNotWhitespaceOnly ($ searchPassword );
188192
189193 try {
190194 $ this ->connector ->bind ($ searchUsername , $ searchPassword );
@@ -232,7 +236,7 @@ public function getAttributes(string $username): array
232236
233237 /**
234238 * @param \Symfony\Component\Ldap\Entry $entry
235- * @return array
239+ * @return array<mixed>
236240 */
237241 private function processAttributes (Entry $ entry ): array
238242 {
0 commit comments