Skip to content

Commit fdbe001

Browse files
committed
General improvements
1 parent 51d7ee4 commit fdbe001

File tree

201 files changed

+1321
-939
lines changed

Some content is hidden

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

201 files changed

+1321
-939
lines changed

.github/workflows/php.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ jobs:
2323
fetch-depth: 0
2424

2525
- name: Lint Code Base
26-
uses: github/super-linter/slim@v4
26+
uses: github/super-linter/slim@v5
2727
env:
28+
LOG_LEVEL: NOTICE
2829
VALIDATE_ALL_CODEBASE: true
2930
LINTER_RULES_PATH: 'tools/linters'
3031
VALIDATE_CSS: true

modules/admin/src/Controller/Config.php

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,24 @@
55
namespace SimpleSAML\Module\admin\Controller;
66

77
use Exception;
8-
use SimpleSAML\Configuration;
8+
use SimpleSAML\{Configuration, Module, Session, Utils};
99
use SimpleSAML\Locale\Translate;
1010
use SimpleSAML\Metadata\MetaDataStorageHandler;
11-
use SimpleSAML\Module;
12-
use SimpleSAML\Session;
13-
use SimpleSAML\Utils;
1411
use SimpleSAML\XHTML\Template;
15-
use Symfony\Component\HttpFoundation\Request;
16-
use Symfony\Component\HttpFoundation\Response;
17-
use Symfony\Component\HttpFoundation\StreamedResponse;
12+
use Symfony\Component\HttpFoundation\{Request, Response, StreamedResponse};
13+
14+
use function curl_close;
15+
use function curl_exec;
16+
use function curl_getinfo;
17+
use function curl_init;
18+
use function curl_setopt;
19+
use function explode;
20+
use function function_exists;
21+
use function json_decode;
22+
use function ltrim;
23+
use function openssl_x509_check_private_key;
24+
use function phpversion;
25+
use function version_compare;
1826

1927
/**
2028
* Controller class for the admin module.
@@ -205,11 +213,11 @@ protected function getPrerequisiteChecks(): array
205213
'descr' => [
206214
Translate::noop('PHP %minimum% or newer is needed. You are running: %current%'),
207215
[
208-
'%minimum%' => '7.4',
216+
'%minimum%' => '8.0',
209217
'%current%' => explode('-', phpversion())[0]
210218
]
211219
],
212-
'enabled' => version_compare(phpversion(), '7.4', '>=')
220+
'enabled' => version_compare(phpversion(), '8.0', '>=')
213221
]
214222
];
215223
$store = $this->config->getOptionalString('store.type', null);

modules/admin/src/Controller/Federation.php

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,31 @@
55
namespace SimpleSAML\Module\admin\Controller;
66

77
use Exception;
8-
use SimpleSAML\Assert\Assert;
9-
use SimpleSAML\Assert\AssertionFailedException;
10-
use SimpleSAML\Auth;
11-
use SimpleSAML\Configuration;
8+
use SimpleSAML\{Auth, Configuration, Logger, Module, Utils};
9+
use SimpleSAML\Assert\{Assert, AssertionFailedException};
1210
use SimpleSAML\Locale\Translate;
13-
use SimpleSAML\Logger;
14-
use SimpleSAML\Metadata\MetaDataStorageHandler;
15-
use SimpleSAML\Metadata\SAMLBuilder;
16-
use SimpleSAML\Metadata\SAMLParser;
17-
use SimpleSAML\Metadata\Signer;
18-
use SimpleSAML\Module;
11+
use SimpleSAML\Metadata\{MetaDataStorageHandler, SAMLBuilder, SAMLParser, Signer};
1912
use SimpleSAML\Module\adfs\IdP\ADFS as ADFS_IdP;
2013
use SimpleSAML\Module\saml\IdP\SAML2 as SAML2_IdP;
2114
use SimpleSAML\SAML2\Constants as C;
2215
use SimpleSAML\SAML2\Exception\ArrayValidationException;
2316
use SimpleSAML\SAML2\XML\md\ContactPerson;
24-
use SimpleSAML\Utils;
2517
use SimpleSAML\XHTML\Template;
26-
use Symfony\Component\HttpFoundation\Request;
27-
use Symfony\Component\HttpFoundation\Response;
28-
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
18+
use Symfony\Component\HttpFoundation\{Request, Response, ResponseHeaderBag};
2919
use Symfony\Component\VarExporter\VarExporter;
3020

21+
use function array_merge;
22+
use function array_pop;
23+
use function array_values;
24+
use function count;
25+
use function file_get_contents;
26+
use function is_array;
27+
use function sprintf;
28+
use function str_replace;
29+
use function trim;
30+
use function urlencode;
31+
use function var_export;
32+
3133
/**
3234
* Controller class for the admin module.
3335
*

modules/admin/src/Controller/Sandbox.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44

55
namespace SimpleSAML\Module\admin\Controller;
66

7-
use SimpleSAML\Configuration;
8-
use SimpleSAML\Session;
7+
use SimpleSAML\{Configuration, Session};
98
use SimpleSAML\XHTML\Template;
109

10+
use function time;
11+
1112
/**
1213
* Controller class for the admin module.
1314
*

modules/admin/src/Controller/Test.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@
44

55
namespace SimpleSAML\Module\admin\Controller;
66

7+
use SimpleSAML\{Auth, Configuration, Module, Session, Utils};
78
use SimpleSAML\Assert\Assert;
8-
use SimpleSAML\Auth;
9-
use SimpleSAML\Configuration;
109
use SimpleSAML\Locale\Translate;
11-
use SimpleSAML\Module;
1210
use SimpleSAML\SAML2\XML\saml\NameID;
13-
use SimpleSAML\Session;
14-
use SimpleSAML\Utils;
1511
use SimpleSAML\XHTML\Template;
16-
use Symfony\Component\HttpFoundation\Request;
17-
use Symfony\Component\HttpFoundation\Response;
12+
use Symfony\Component\HttpFoundation\{Request, Response};
13+
14+
use function is_null;
15+
use function time;
16+
use function urlencode;
1817

1918
/**
2019
* Controller class for the admin module.

modules/core/hooks/hook_sanitycheck.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22

33
declare(strict_types=1);
44

5+
use SimpleSAML\{Configuration, Module};
56
use SimpleSAML\Assert\Assert;
6-
use SimpleSAML\Configuration;
7-
use SimpleSAML\Module;
7+
8+
use function in_array;
9+
use function is_array;
10+
use function phpversion;
11+
use function version_compare;
812

913
/**
1014
* Hook to do sanitycheck
@@ -30,7 +34,7 @@ function core_hook_sanitycheck(array &$hookinfo): void
3034
$hookinfo['info'][] = '[core] In config.php technicalcontact_email is set properly';
3135
}
3236

33-
if (version_compare(phpversion(), '7.4', '>=')) {
37+
if (version_compare(phpversion(), '8.0', '>=')) {
3438
$hookinfo['info'][] = '[core] You are running a PHP version suitable for SimpleSAMLphp.';
3539
} else {
3640
$hookinfo['errors'][] = '[core] You are running an old PHP installation. ' .

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
use SimpleSAML\Assert\Assert;
99
use SimpleSAML\Auth;
1010

11+
use function array_key_exists;
12+
use function array_merge;
13+
use function is_array;
14+
use function is_int;
15+
use function is_string;
16+
use function var_export;
17+
1118
/**
1219
* Filter to add attributes.
1320
*

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,18 @@
44

55
namespace SimpleSAML\Module\core\Auth\Process;
66

7+
use SimpleSAML\{Auth, Error};
78
use SimpleSAML\Assert\Assert;
8-
use SimpleSAML\Auth;
9-
use SimpleSAML\Error;
9+
10+
use function array_diff;
11+
use function array_key_exists;
12+
use function array_merge;
13+
use function array_values;
14+
use function is_int;
15+
use function is_string;
16+
use function preg_match;
17+
use function preg_replace;
18+
use function var_export;
1019

1120
/**
1221
* Filter to modify attributes using regular expressions
@@ -39,7 +48,7 @@ class AttributeAlter extends Auth\ProcessingFilter
3948
* String to replace the pattern found with.
4049
* @var string|false
4150
*/
42-
private $replacement = false;
51+
private string|false $replacement = false;
4352

4453
/**
4554
* Attribute to search in

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
use SimpleSAML\Assert\Assert;
99
use SimpleSAML\Auth;
1010

11+
use function array_key_exists;
12+
use function is_array;
13+
use function is_string;
14+
use function var_export;
15+
1116
/**
1217
* Attribute filter for renaming attributes.
1318
*

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,18 @@
44

55
namespace SimpleSAML\Module\core\Auth\Process;
66

7+
use SimpleSAML\{Auth, Error, Logger};
78
use SimpleSAML\Assert\Assert;
8-
use SimpleSAML\Auth;
9-
use SimpleSAML\Error;
10-
use SimpleSAML\Logger;
9+
10+
use function array_intersect;
11+
use function array_key_exists;
12+
use function array_uintersect;
13+
use function in_array;
14+
use function is_array;
15+
use function is_int;
16+
use function is_string;
17+
use function preg_match;
18+
use function var_export;
1119

1220
/**
1321
* A filter for limiting which attributes are passed on.

0 commit comments

Comments
 (0)