@@ -32,7 +32,7 @@ class Radius extends UserPassBase
3232 public const RADIUS_NAS_IDENTIFIER = 32 ;
3333
3434 /**
35- * @var array The list of radius servers to use.
35+ * @var array<mixed> The list of radius servers to use.
3636 */
3737 private array $ servers ;
3838
@@ -91,8 +91,8 @@ class Radius extends UserPassBase
9191 /**
9292 * Constructor for this authentication source.
9393 *
94- * @param array $info Information about this authentication source.
95- * @param array $config Configuration.
94+ * @param array<mixed> $info Information about this authentication source.
95+ * @param array<mixed> $config Configuration.
9696 */
9797 public function __construct (array $ info , array $ config )
9898 {
@@ -135,7 +135,7 @@ public function __construct(array $info, array $config)
135135 *
136136 * @param string $username The username the user wrote.
137137 * @param string $password The password the user wrote.
138- * @return array[] Associative array with the user's attributes.
138+ * @return array<mixed> Associative array with the user's attributes.
139139 */
140140 protected function login (
141141 string $ username ,
@@ -223,7 +223,7 @@ protected function login(
223223
224224 /**
225225 * @param \Dapphp\Radius\Radius $radius
226- * @return array
226+ * @return array<mixed>
227227 */
228228 private function getAttributes (RadiusClient $ radius ): array
229229 {
@@ -244,7 +244,7 @@ private function getAttributes(RadiusClient $radius): array
244244 $ resv = $ resa ['data ' ];
245245 if ($ resv === false ) {
246246 throw new Exception (sprintf (
247- 'Error getting vendor specific attribute ' ,
247+ 'Error getting vendor specific attribute: %s (%d) ' ,
248248 $ radius ->getErrorMessage (),
249249 $ radius ->getErrorCode (),
250250 ));
@@ -259,15 +259,9 @@ private function getAttributes(RadiusClient $radius): array
259259 }
260260
261261 $ attrib_name = strtok ($ datav , '= ' );
262- /** @psalm-suppress TooFewArguments */
263262 $ attrib_value = strtok ('= ' );
264263
265- // if the attribute name is already in result set, add another value
266- if (array_key_exists ($ attrib_name , $ attributes )) {
267- $ attributes [$ attrib_name ][] = $ attrib_value ;
268- } else {
269- $ attributes [$ attrib_name ] = [$ attrib_value ];
270- }
264+ $ attributes [$ attrib_name ] = [$ attrib_value ];
271265
272266 return $ attributes ;
273267 }
0 commit comments