mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 18:06:51 +02:00
MDL-71017 oath2: configuration check fix and return types
This commit is contained in:
parent
5a6f05c605
commit
57a444d31f
4 changed files with 10 additions and 9 deletions
|
@ -111,11 +111,12 @@ class api {
|
|||
/**
|
||||
* List all the issuers, ordered by the sortorder field
|
||||
*
|
||||
* @param bool $showall also include issues that are configured to be shown only on login page
|
||||
* @param bool $includeloginonly also include issuers that are configured to be shown only on login page,
|
||||
* By default false, in this case the method returns all issuers that can be used in services
|
||||
* @return \core\oauth2\issuer[]
|
||||
*/
|
||||
public static function get_all_issuers(bool $showall = false) {
|
||||
if ($showall) {
|
||||
public static function get_all_issuers(bool $includeloginonly = false) {
|
||||
if ($includeloginonly) {
|
||||
return issuer::get_records([], 'sortorder');
|
||||
} else {
|
||||
return array_values(issuer::get_records_select('showonloginpage<>?', [issuer::LOGINONLY], 'sortorder'));
|
||||
|
|
|
@ -196,7 +196,7 @@ class issuer extends persistent {
|
|||
* @return bool
|
||||
* @throws \coding_exception
|
||||
*/
|
||||
public function is_available_for_login() {
|
||||
public function is_available_for_login(): bool {
|
||||
return $this->get('id') &&
|
||||
$this->is_configured() &&
|
||||
$this->get('showonloginpage') != self::SERVICEONLY &&
|
||||
|
@ -265,7 +265,7 @@ class issuer extends persistent {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_display_name() {
|
||||
public function get_display_name(): string {
|
||||
return $this->get('loginpagename') ? $this->get('loginpagename') : $this->get('name');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue