Skip to content

Commit 73181fd

Browse files
authored
Merge pull request #1 from simplesamlphp/psalm
Add some missing functions to stub
2 parents aca8101 + 0c28a48 commit 73181fd

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

lib/Auth/Source/Radius.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function __construct($info, $config)
123123
*
124124
* @param string $username The username the user wrote.
125125
* @param string $password The password the user wrote.
126-
* @return array Associative array with the user's attributes.
126+
* @return array[] Associative array with the user's attributes.
127127
*/
128128
protected function login($username, $password)
129129
{
@@ -218,7 +218,7 @@ protected function login($username, $password)
218218
}
219219

220220
// Use the received user name
221-
if ($resa['attr'] == \RADIUS_USER_NAME) {
221+
if ($resa['attr'] === \RADIUS_USER_NAME && $usernameAttribute !== null) {
222222
$attributes[$usernameAttribute] = [$resa['data']];
223223
continue;
224224
}

tests/Utils/Stubs/radius.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,3 +405,37 @@ function radius_create_request($radius_handle, $type)
405405
function radius_get_vendor_attr($data)
406406
{
407407
}
408+
409+
/**
410+
* Attaches a binary attribute
411+
* @param resource $radius_handle
412+
* @param int $type
413+
* @param string $value
414+
* @param int $options
415+
* @param int $tag
416+
* @return bool
417+
* @since 1.1.0
418+
*/
419+
function radius_put_attr(resource $radius_handle, $type, $value, $options = 0, $tag = null)
420+
{
421+
}
422+
423+
/**
424+
* Extracts an attribute
425+
* @param resource $radius_handle
426+
* @return mixed
427+
* @since 1.1.0
428+
*/
429+
function radius_get_attr($radius_handle)
430+
{
431+
}
432+
433+
/**
434+
* Returns an error message
435+
* @param resource $radius_handle
436+
* @return string
437+
* @since 1.1.0
438+
*/
439+
function radius_strerror(resource $radius_handle)
440+
{
441+
}

0 commit comments

Comments
 (0)