Skip to content

Commit 47d523d

Browse files
committed
Typed properties & strict typing
1 parent 54132da commit 47d523d

27 files changed

+138
-76
lines changed

lib/Cas/AttributeExtractor.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace SimpleSAML\Module\casserver\Cas;
46

57
use SimpleSAML\Configuration;

lib/Cas/CasException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace SimpleSAML\Module\casserver\Cas;
46

57
/**
@@ -15,7 +17,7 @@ class CasException extends \Exception
1517
public const INVALID_SERVICE = 'INVALID_SERVICE';
1618

1719
/** @var string */
18-
private $casCode;
20+
private string $casCode;
1921

2022
/**
2123
* CasException constructor.

lib/Cas/Protocol/Cas10.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
*
2222
*/
2323

24+
declare(strict_types=1);
25+
2426
namespace SimpleSAML\Module\casserver\Cas\Protocol;
2527

2628
use SimpleSAML\Configuration;

lib/Cas/Protocol/Cas20.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
*
2222
*/
2323

24+
declare(strict_types=1);
25+
2426
namespace SimpleSAML\Module\casserver\Cas\Protocol;
2527

2628
use DOMDocument;
@@ -32,19 +34,19 @@
3234
class Cas20
3335
{
3436
/** @var bool $sendAttributes */
35-
private $sendAttributes;
37+
private bool $sendAttributes;
3638

3739
/** @var bool $base64EncodeAttributes */
38-
private $base64EncodeAttributes;
40+
private bool $base64EncodeAttributes;
3941

4042
/** @var string|null $base64IndicatorAttribute */
41-
private $base64IndicatorAttribute;
43+
private ?string $base64IndicatorAttribute;
4244

4345
/** @var array $attributes */
44-
private $attributes = [];
46+
private array $attributes = [];
4547

4648
/** @var string|null $proxyGrantingTicketIOU */
47-
private $proxyGrantingTicketIOU = null;
49+
private ?string $proxyGrantingTicketIOU = null;
4850

4951

5052
/**

lib/Cas/Protocol/SamlValidateResponder.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace SimpleSAML\Module\casserver\Cas\Protocol;
46

57
use SimpleSAML\Configuration;

lib/Cas/ServiceValidator.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace SimpleSAML\Module\casserver\Cas;
46

57
use SimpleSAML\Configuration;
@@ -12,9 +14,9 @@
1214
class ServiceValidator
1315
{
1416
/**
15-
* @var Configuration
17+
* @var \SimpleSAML\Configuration
1618
*/
17-
private $mainConfig;
19+
private Configuration $mainConfig;
1820

1921
/**
2022
* ServiceValidator constructor.

lib/Cas/Ticket/DelegatingTicketStore.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace SimpleSAML\Module\casserver\Cas\Ticket;
46

57
use Exception;
@@ -17,17 +19,18 @@ class DelegatingTicketStore extends TicketStore
1719
/**
1820
* @var string Delegate to 'all', 'first', or a named entry.
1921
*/
20-
private $delegateTo = 'all';
22+
private string $delegateTo = 'all';
2123

2224
/**
23-
* @var TicketStore[]
25+
* @var \SimpleSAML\Module\casserver\Cas\Ticket\TicketStore[]
2426
*/
25-
private $ticketStores = [];
27+
private array $ticketStores = [];
2628

2729
/**
28-
* @var TicketStore
30+
* @var \SimpleSAML\Module\casserver\Cas\Ticket\TicketStore
2931
*/
30-
private $primaryDelegate;
32+
private TicketStore $primaryDelegate;
33+
3134

3235
/**
3336
* @param \SimpleSAML\Configuration $casConfig The cas configuration.

lib/Cas/Ticket/FileSystemTicketStore.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
*
2222
*/
2323

24+
declare(strict_types=1);
25+
2426
namespace SimpleSAML\Module\casserver\Cas\Ticket;
2527

2628
use Exception;
@@ -29,7 +31,7 @@
2931
class FileSystemTicketStore extends TicketStore
3032
{
3133
/** @var string $pathToTicketDirectory */
32-
private $pathToTicketDirectory;
34+
private string $pathToTicketDirectory;
3335

3436

3537
/**

lib/Cas/Ticket/MemCacheTicketStore.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
*
2222
*/
2323

24+
declare(strict_types=1);
25+
2426
namespace SimpleSAML\Module\casserver\Cas\Ticket;
2527

2628
use SimpleSAML\Configuration;
@@ -29,7 +31,7 @@
2931
class MemCacheTicketStore extends TicketStore
3032
{
3133
/** @var string $prefix */
32-
private $prefix = '';
34+
private string $prefix = '';
3335

3436

3537
/**

lib/Cas/Ticket/RedisTicketStore.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
*
2222
*/
2323

24+
declare(strict_types=1);
25+
2426
namespace SimpleSAML\Module\casserver\Cas\Ticket;
2527

2628
use SimpleSAML\Configuration;
@@ -29,10 +31,10 @@
2931
class RedisTicketStore extends TicketStore
3032
{
3133
/** @var string $prefix */
32-
private $prefix = '';
34+
private string $prefix = '';
3335

3436
/** @var \SimpleSAML\Store\Redis $redis */
35-
private $redis;
37+
private Redis $redis;
3638

3739

3840
/**

0 commit comments

Comments
 (0)