Skip to content

Commit

Permalink
Merge pull request #1 from simplesamlphp/psalm
Browse files Browse the repository at this point in the history
Add some missing functions to stub
  • Loading branch information
tvdijen committed Mar 25, 2019
2 parents aca8101 + 0c28a48 commit 73181fd
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Auth/Source/Radius.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function __construct($info, $config)
*
* @param string $username The username the user wrote.
* @param string $password The password the user wrote.
* @return array Associative array with the user's attributes.
* @return array[] Associative array with the user's attributes.
*/
protected function login($username, $password)
{
Expand Down Expand Up @@ -218,7 +218,7 @@ protected function login($username, $password)
}

// Use the received user name
if ($resa['attr'] == \RADIUS_USER_NAME) {
if ($resa['attr'] === \RADIUS_USER_NAME && $usernameAttribute !== null) {
$attributes[$usernameAttribute] = [$resa['data']];
continue;
}
Expand Down
34 changes: 34 additions & 0 deletions tests/Utils/Stubs/radius.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,3 +405,37 @@ function radius_create_request($radius_handle, $type)
function radius_get_vendor_attr($data)
{
}

/**
* Attaches a binary attribute
* @param resource $radius_handle
* @param int $type
* @param string $value
* @param int $options
* @param int $tag
* @return bool
* @since 1.1.0
*/
function radius_put_attr(resource $radius_handle, $type, $value, $options = 0, $tag = null)
{
}

/**
* Extracts an attribute
* @param resource $radius_handle
* @return mixed
* @since 1.1.0
*/
function radius_get_attr($radius_handle)
{
}

/**
* Returns an error message
* @param resource $radius_handle
* @return string
* @since 1.1.0
*/
function radius_strerror(resource $radius_handle)
{
}

0 comments on commit 73181fd

Please sign in to comment.