Skip to content

Commit 1caf21d

Browse files
committed
Leverage PHP 8.0 capabilities
1 parent 1d952fb commit 1caf21d

79 files changed

Lines changed: 286 additions & 590 deletions

File tree

Some content is hidden

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

bin/convertTranslations.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function codifyWithSource(array $sourcePairs, array $destPairs): array
4141
function dissectFile(array $fileInputRaw): array
4242
{
4343
$pairs = [];
44-
// create an array with MSGID => MSGSTR
44+
// create an array with MSGID => MSGSTR
4545
foreach ($fileInputRaw as $rowIndex => $oneLine) {
4646
if (preg_match("/^msgid/", $oneLine)) {
4747
$msgId = $oneLine;

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"gettext/gettext": "^5.7",
6060
"gettext/translator": "^1.1",
6161
"phpmailer/phpmailer": "^6.8",
62+
"psr/log": "^3.0",
6263
"simplesamlphp/assert": "^1.0.0",
6364
"simplesamlphp/composer-module-installer": "^1.3",
6465
"simplesamlphp/saml2": "^4.6",

composer.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/admin/src/Controller/Config.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ class Config
2828

2929
public const RELEASES_API = 'https://api.github.com/repos/simplesamlphp/simplesamlphp/releases/latest';
3030

31-
/** @var \SimpleSAML\Configuration */
32-
protected Configuration $config;
33-
3431
/** @var \SimpleSAML\Utils\Auth */
3532
protected Utils\Auth $authUtils;
3633

@@ -40,20 +37,17 @@ class Config
4037
/** @var \SimpleSAML\Module\admin\Controller\Menu */
4138
protected Menu $menu;
4239

43-
/** @var \SimpleSAML\Session */
44-
protected Session $session;
45-
4640

4741
/**
4842
* ConfigController constructor.
4943
*
5044
* @param \SimpleSAML\Configuration $config The configuration to use.
5145
* @param \SimpleSAML\Session $session The current user session.
5246
*/
53-
public function __construct(Configuration $config, Session $session)
54-
{
55-
$this->config = $config;
56-
$this->session = $session;
47+
public function __construct(
48+
protected Configuration $config,
49+
protected Session $session
50+
) {
5751
$this->menu = new Menu();
5852
$this->authUtils = new Utils\Auth();
5953
$this->httpUtils = new Utils\HTTP();

modules/admin/src/Controller/Federation.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434
*/
3535
class Federation
3636
{
37-
/** @var \SimpleSAML\Configuration */
38-
protected Configuration $config;
39-
4037
/**
4138
* @var \SimpleSAML\Auth\Source|string
4239
* @psalm-var \SimpleSAML\Auth\Source|class-string
@@ -61,9 +58,9 @@ class Federation
6158
*
6259
* @param \SimpleSAML\Configuration $config The configuration to use.
6360
*/
64-
public function __construct(Configuration $config)
65-
{
66-
$this->config = $config;
61+
public function __construct(
62+
protected Configuration $config
63+
) {
6764
$this->menu = new Menu();
6865
$this->mdHandler = MetaDataStorageHandler::getMetadataHandler();
6966
$this->authUtils = new Utils\Auth();

modules/admin/src/Controller/Sandbox.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,16 @@
1717
*/
1818
class Sandbox
1919
{
20-
/** @var \SimpleSAML\Configuration */
21-
protected Configuration $config;
22-
23-
/** @var \SimpleSAML\Session */
24-
protected Session $session;
25-
26-
2720
/**
2821
* Sandbox constructor.
2922
*
3023
* @param \SimpleSAML\Configuration $config The configuration to use.
3124
* @param \SimpleSAML\Session $session The current user session.
3225
*/
33-
public function __construct(Configuration $config, Session $session)
34-
{
35-
$this->config = $config;
36-
$this->session = $session;
26+
public function __construct(
27+
protected Configuration $config,
28+
protected Session $session
29+
) {
3730
}
3831

3932

modules/admin/src/Controller/Test.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
*/
2828
class Test
2929
{
30-
/** @var \SimpleSAML\Configuration */
31-
protected Configuration $config;
32-
3330
/**
3431
* @var \SimpleSAML\Utils\Auth
3532
*/
@@ -50,20 +47,17 @@ class Test
5047
/** @var \SimpleSAML\Module\admin\Controller\Menu */
5148
protected Menu $menu;
5249

53-
/** @var \SimpleSAML\Session */
54-
protected Session $session;
55-
5650

5751
/**
5852
* TestController constructor.
5953
*
6054
* @param \SimpleSAML\Configuration $config The configuration to use.
6155
* @param \SimpleSAML\Session $session The current user session.
6256
*/
63-
public function __construct(Configuration $config, Session $session)
64-
{
65-
$this->config = $config;
66-
$this->session = $session;
57+
public function __construct(
58+
protected Configuration $config,
59+
protected Session $session
60+
) {
6761
$this->menu = new Menu();
6862
$this->authUtils = new Utils\Auth();
6963
}

modules/core/src/Auth/Process/AttributeAlter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ class AttributeAlter extends Auth\ProcessingFilter
3737

3838
/**
3939
* String to replace the pattern found with.
40-
* @var string|false
40+
* @var string|false|null
4141
*/
42-
private $replacement = false;
42+
private string|bool|null $replacement = false;
4343

4444
/**
4545
* Attribute to search in

modules/core/src/Auth/Process/TargetedID.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class TargetedID extends Auth\ProcessingFilter
5050
/**
5151
* @var \SimpleSAML\Utils\Config
5252
*/
53-
protected $configUtils;
53+
protected Utils\Config $configUtils;
5454

5555

5656
/**

modules/core/src/Auth/Source/AdminPassword.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function __construct(array $info, array $config)
5050
protected function login(string $username, string $password): array
5151
{
5252
$config = Configuration::getInstance();
53-
$adminPassword = $config->getOptionalString('auth.adminpassword', '123');
53+
$adminPassword = $config->getString('auth.adminpassword');
5454
if ($adminPassword === '123') {
5555
// We require that the user changes the password
5656
throw new Error\Error('NOTSET');

0 commit comments

Comments
 (0)