Skip to content

Commit 227c55c

Browse files
committed
Add scope and types to variables (#499)
1 parent 3d33cc8 commit 227c55c

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

classes/output/verify_certificate_result.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,32 +39,32 @@ class verify_certificate_result implements templatable, renderable {
3939
/**
4040
* @var string The URL to the user's profile.
4141
*/
42-
public $userprofileurl;
42+
public string $userprofileurl;
4343

4444
/**
4545
* @var string The user's fullname.
4646
*/
47-
public $userfullname;
47+
public string $userfullname;
4848

4949
/**
5050
* @var string The URL to the course page.
5151
*/
52-
public $courseurl;
52+
public string $courseurl;
5353

5454
/**
5555
* @var string The course's fullname.
5656
*/
57-
public $coursefullname;
57+
public string $coursefullname;
5858

5959
/**
6060
* @var string The certificate's name.
6161
*/
62-
public $certificatename;
62+
public string $certificatename;
6363

6464
/**
65-
* @var int The certificate's expiry date (optional).
65+
* @var int|null The certificate's expiry date (optional).
6666
*/
67-
public $expiry;
67+
public ?int $expiry;
6868

6969
/**
7070
* Constructor.

element/expiry/classes/element.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,30 +38,30 @@ class element extends \mod_customcert\element {
3838
/**
3939
* Date - Relative expiry date of 1 year
4040
*/
41-
const EXPIRY_ONE = '-8';
41+
private const EXPIRY_ONE = '-8';
4242

4343
/**
4444
* Date - Relative expiry date of 2 year
4545
*/
46-
const EXPIRY_TWO = '-9';
46+
private const EXPIRY_TWO = '-9';
4747

4848
/**
4949
* Date - Relative expiry date of 3 year
5050
*/
51-
const EXPIRY_THREE = '-10';
51+
private const EXPIRY_THREE = '-10';
5252

5353
/**
5454
* Date - Relative expiry date of 4 year
5555
*/
56-
const EXPIRY_FOUR = '-11';
56+
private const EXPIRY_FOUR = '-11';
5757

5858
/**
5959
* Date - Relative expiry date of 5 year
6060
*/
61-
const EXPIRY_FIVE = '-12';
61+
private const EXPIRY_FIVE = '-12';
6262

6363
/** @var array Map EXPIRY_ consts to strtotime()'s $datetime param. */
64-
private $relative = [
64+
private array $relative = [
6565
self::EXPIRY_ONE => '+1 year',
6666
self::EXPIRY_TWO => '+2 years',
6767
self::EXPIRY_THREE => '+3 years',

0 commit comments

Comments
 (0)