Skip to content

Commit 9063f62

Browse files
committed
fix linting
1 parent f429495 commit 9063f62

File tree

154 files changed

+18704
-74
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+18704
-74
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
/vendor/
21
.well-known/

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ default:
3636
- export PATH="/opt/moodle-plugin-ci/bin:/opt/moodle-plugin-ci/vendor/bin:$PATH"
3737
# TODO not always needed
3838
# install moodle
39-
# - moodle-plugin-ci install --db-host db
39+
# - moodle-plugin-ci install --db-host db
4040
# - '{ php -S 0.0.0.0:8000 -t "$CI_PROJECT_DIR/moodle" >/dev/null 2>&1 & }'
4141

4242
# install dependencies:

classes/claim/address.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,17 @@
2929
*/
3030
class address implements claim {
3131

32-
3332
/**
3433
* Get addres claim.
35-
* @param array of core_user user user want the address claim from
34+
* @param array $user core_user user user want the address claim from
3635
* @return array() Returns address information of user
3736
*/
3837
public function claim($user): array {
3938
$claims = [
4039
'address' => [
4140
// Not inplemented 'formatted', 'region' 'postal_code'.
4241
'street_address' => $user->address,
43-
'locality' => $user->address,
42+
'locality' => $user->city,
4443
'country' => $user->country,
4544
],
4645
];

classes/claim/claim.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ interface claim {
3333

3434
/**
3535
* Get addres claim.
36-
* @param array of core_user user user want the address claim from
36+
* @param array $user core_user user user want the address claim from
3737
* @return array() Returns address information of user
3838
*/
3939
public function claim(array $user);

classes/claim/email.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class email implements claim {
3131

3232
/**
3333
* Get email claim.
34-
* @param array of core_user user user want the email claim from
34+
* @param array $user core_user user user want the email claim from
3535
* @return array() Returns email information of user
3636
*/
3737
public function claim($user) {

classes/claim/enrolments.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class enrolments implements claim {
3131
// TODO maybe also return role, and external id.
3232
/**
3333
* Get addres claim.
34-
* @param array of core_user user user want the address claim from
34+
* @param array $user core_user want the address claim from
3535
* @return array() Returns address information of user enrolments which array of course short names
3636
*/
3737
public function claim($user) {

classes/claim/phone.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class phone implements claim {
3131

3232
/**
3333
* Get phone claim.
34-
* @param array of core_user user user want the address claim from
34+
* @param array $user core_user want the address claim from
3535
* @return array() Returns phone_number information of user
3636
*/
3737
public function claim($user) {

classes/claim/profile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class profile implements claim {
3232

3333
/**
3434
* Get addres claim.
35-
* @param array of core_user user user want the address claim from
35+
* @param array $user core_user want the address claim from
3636
* @return array() Returns profile information of user
3737
*/
3838
public function claim($user) {

classes/client.php

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,38 @@
2727
* class that manges settings for client for this IdP.
2828
*/
2929
class client {
30-
/**@var int id primary for this client in the database */
30+
/** @var int $id primary for this client in the database */
3131
public int $id; // Has to be pulic now because the way its send to database in update.
3232

33-
/**@var string $clientid name of the client */
33+
/** @var string $clientid name of the client */
3434
public string $clientid;
35-
/**@var string $clientsecret password of this client*/
35+
36+
/** @var string $clientsecret password of this client*/
3637
public string $clientsecret;
37-
/**@var string $redirecturi addres of the clinet to send user to after identification*/
38+
39+
/** @var string $redirecturi addres of the clinet to send user to after identification*/
3840
public string $redirecturi;
39-
/**@var array $granttypes types of oauth flows server will accept for this client*/
41+
42+
/** @var array $granttypes types of oauth flows server will accept for this client*/
4043
public array $granttypes;
41-
/**@var array $scopes the client is allowed to request, which in our case are the claims*/
44+
45+
/** @var array $scope the client is allowed to request, which in our case are the claims*/
4246
public array $scope;
43-
/**@var int $userid if client grantype used is client_authenticat. which user the client inperonates */
47+
48+
/** @var int $userid if client grantype used is client_authenticat. which user the client inperonates */
4449
public int $userid;
45-
/**@var int $noconfirmation if user is asked to confirm that client is allowed to get this information of the user*/
50+
51+
/** @var int $noconfirmation if user is asked to confirm that client is allowed to get this information of the user*/
4652
public int $noconfirmation;
4753

4854
/**
4955
* Initialze the client class.
56+
* @param int $clientid
57+
* @param string $redirecturi
58+
* @param array $granttypes
59+
* @param array $scope
60+
* @param int $userid
61+
* @param bool $noconfirmation
5062
*/
5163
public function __construct($clientid, $redirecturi, $granttypes, $scope, $userid, $noconfirmation) {
5264
$this->clientid = $clientid;
@@ -71,6 +83,8 @@ public function id() {
7183
// TODO Use $storage->getClientDetails instead .
7284
/**
7385
* Get client by client id from database.
86+
*
87+
* @param int $id clientid
7488
*/
7589
public static function get_client_by_id($id) {
7690
global $DB;
@@ -130,6 +144,8 @@ public function delete() {
130144

131145
/**
132146
* Generate public private key pair
147+
*
148+
* @param int $clientid
133149
*/
134150
public static function generate_key_pair($clientid) {
135151
global $DB;

classes/form/authorize.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,15 @@
1818
* local_oauth user granted event.
1919
*
2020
* @package local_oauth
21-
* @copyright
21+
* @copyright https://github.com/examus/moodle-local_oauth
2222
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2323
*/
2424
namespace local_oauth\form;
2525

2626
use moodleform;
2727

2828
/**
29-
* Form that request the use if he the client should be authorize,
30-
* to get information specified by the requested scope.
29+
* Form that request the use if he the client should be authorize, to get information specified by the requested scope.
3130
*/
3231
class authorize extends moodleform {
3332

0 commit comments

Comments
 (0)