Skip to content

Commit 9007f3a

Browse files
authored
Merge pull request #20 from simplesamlphp/feature/php83
Feature/php83
2 parents 76d65ab + 4109efa commit 9007f3a

12 files changed

+40
-103
lines changed

.github/workflows/php.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
php-version: ['8.2', '8.3', '8.4', '8.5']
21+
php-version: ['8.3', '8.4', '8.5']
2222

2323
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/[email protected]
2424
with:
@@ -44,7 +44,7 @@ jobs:
4444
fail-fast: false
4545
matrix:
4646
operating-system: [ubuntu-latest]
47-
php-versions: ['8.2', '8.3', '8.4', '8.5']
47+
php-versions: ['8.3', '8.4', '8.5']
4848

4949
steps:
5050
- name: Setup PHP, with composer and extensions
@@ -107,7 +107,7 @@ jobs:
107107
fail-fast: true
108108
matrix:
109109
operating-system: [windows-latest]
110-
php-versions: ['8.2', '8.3', '8.4', '8.5']
110+
php-versions: ['8.3', '8.4', '8.5']
111111

112112
steps:
113113
- name: Setup PHP, with composer and extensions
@@ -225,7 +225,7 @@ jobs:
225225
uses: shivammathur/setup-php@v2
226226
with:
227227
# Should be the lowest supported version
228-
php-version: '8.2'
228+
php-version: '8.3'
229229
extensions: ctype, date, dom, filter, hash, intl, mbstring, openssl, pcre, spl, xml
230230
tools: composer
231231
coverage: none

.github/workflows/reusable_phplinter.yml

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on: # yamllint disable-line rule:truthy
1919
default: ${{ github.ref }}
2020

2121
env:
22-
supported: '["7.4", "8.0", "8.1", "8.2", "8.3", "8.4", "8.5"]'
22+
supported: '["8.3", "8.4", "8.5"]'
2323

2424
jobs:
2525
linter:
@@ -45,29 +45,10 @@ jobs:
4545
coverage: "none"
4646
extensions: :redis
4747

48-
- name: Install overtrue/phplint (v3.4)
49-
if: inputs.php-version == '7.4'
48+
- name: Install overtrue/phplint (v9.7)
5049
run: |
5150
sleep $((random % 10))
52-
phive install overtrue/phplint@~3.4.0 --force-accept-unsigned --target ./bin
53-
54-
- name: Install overtrue/phplint (v4.5)
55-
if: inputs.php-version == '8.0'
56-
run: |
57-
sleep $((random % 10))
58-
phive install overtrue/phplint@~4.5.0 --force-accept-unsigned --target ./bin
59-
60-
- name: Install overtrue/phplint (v9.4)
61-
if: inputs.php-version == '8.1'
62-
run: |
63-
sleep $((random % 10))
64-
phive install overtrue/phplint@~9.4.0 --force-accept-unsigned --target ./bin
65-
66-
- name: Install overtrue/phplint (v9.6)
67-
if: inputs.php-version != '7.4' && inputs.php-version != '8.0' && inputs.php-version != '8.1'
68-
run: |
69-
sleep $((random % 10))
70-
phive install overtrue/phplint@~9.6.0 --force-accept-unsigned --target ./bin
51+
phive install overtrue/phplint@~9.7.1 --force-accept-unsigned --target ./bin
7152
7253
- name: Lint PHP files
7354
run: |

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@
2121
}
2222
},
2323
"require": {
24-
"php": "^8.2",
24+
"php": "^8.3",
2525
"ext-curl": "*",
2626

2727
"icanhazstring/composer-unused": "^0.9",
28-
"maglnet/composer-require-checker": "^4",
28+
"maglnet/composer-require-checker": "^4.19",
2929
"phpstan/extension-installer": "^1.4",
3030
"phpstan/phpstan": "^2.1",
3131
"phpstan/phpstan-mockery": "^2.0",
3232
"phpstan/phpstan-phpunit": "^2.0",
33-
"phpunit/phpunit": "^11.5 || ^12.3",
33+
"phpunit/phpunit": "^12.3",
3434
"psr/log": "^3.0",
35-
"slevomat/coding-standard": "^8.20",
35+
"slevomat/coding-standard": "^8.25",
3636
"squizlabs/php_codesniffer": "^4.0",
37-
"symfony/phpunit-bridge": "^7.3 || ^8.0"
37+
"symfony/phpunit-bridge": "^8.0"
3838
},
3939
"require-dev": {
4040
"simplesamlphp/simplesamlphp": "^2.5@dev"

lib/ArrayLogger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use SimpleSAML\Logger\LoggingHandlerInterface;
99

1010
/**
11-
* @deprecated - superseeded by PSR-3 compliant SimpleTestLogger
1211
*/
1312
class ArrayLogger implements LoggingHandlerInterface
1413
{
@@ -18,6 +17,7 @@ class ArrayLogger implements LoggingHandlerInterface
1817
public array $logs = [];
1918

2019

20+
#[\Deprecated('Superseeded by PSR-3 compliant SimpleTestLogger', '20-05-2023')]
2121
public function __construct(Configuration $config)
2222
{
2323
// don't do anything with the configuration

lib/BuiltInServer.php

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,31 +41,23 @@ class BuiltInServer
4141
{
4242
/**
4343
* The PID of the running server.
44-
*
45-
* @var int
4644
*/
47-
protected $pid = 0;
45+
protected int $pid = 0;
4846

4947
/**
5048
* The address (host:port) where the server is listening for connections after being started.
51-
*
52-
* @var string
5349
*/
54-
protected $address = 'example.org';
50+
protected string $address = 'example.org';
5551

5652
/**
5753
* The name of a "router" file to run for every request performed to this server.
58-
*
59-
* @var string
6054
*/
61-
protected $router = '';
55+
protected string $router = '';
6256

6357
/**
6458
* The document root of the server.
65-
*
66-
* @var string
6759
*/
68-
protected $docroot;
60+
protected string $docroot;
6961

7062

7163
/**
@@ -158,7 +150,6 @@ public function start(): string
158150

159151
/**
160152
* Stop the built-in server.
161-
* @return void
162153
*/
163154
public function stop(): void
164155
{
@@ -200,7 +191,6 @@ public function getRouter(): string
200191
* Set the "router" file.
201192
*
202193
* @param string $router The name of a "router" file to use when starting the server.
203-
* @return void
204194
*/
205195
public function setRouter(string $router): void
206196
{

lib/ClearStateTestCase.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@ class ClearStateTestCase extends TestCase
1313
{
1414
/**
1515
* Used for managing and clearing state
16-
* @var \SimpleSAML\TestUtils\StateClearer|null
1716
*/
18-
protected static $stateClearer = null;
17+
protected static ?StateClearer $stateClearer = null;
1918

2019

2120
/**
22-
* @return void
2321
*/
2422
public static function setUpBeforeClass(): void
2523
{
@@ -31,7 +29,6 @@ public static function setUpBeforeClass(): void
3129

3230

3331
/**
34-
* @return void
3532
*/
3633
protected function setUp(): void
3734
{
@@ -40,7 +37,6 @@ protected function setUp(): void
4037

4138

4239
/**
43-
* @return void
4440
*/
4541
public static function tearDownAfterClass(): void
4642
{
@@ -50,7 +46,6 @@ public static function tearDownAfterClass(): void
5046

5147
/**
5248
* Clear any SSP global state to reduce spill over between tests.
53-
* @return void
5449
*/
5550
public static function clearState(): void
5651
{

lib/ReduceSpillOverTest.php

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

1010
/**
1111
* Test that ensures state doesn't spill over between tests
12+
*
1213
* @package SimpleSAML\Test\Utils
1314
*/
1415
class ReduceSpillOverTest extends ClearStateTestCase
1516
{
1617
/**
1718
* Set some global state
18-
* @return void
1919
*/
2020
public function testSetState(): void
2121
{
@@ -28,7 +28,7 @@ public function testSetState(): void
2828

2929
/**
3030
* Confirm global state removed prior to next test
31-
* @return void
31+
*
3232
* @throws \SimpleSAML\Error\ConfigurationError
3333
*/
3434
public function testStateRemoved(): void

lib/SigningTestCase.php

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,42 +16,31 @@
1616
*/
1717
class SigningTestCase extends TestCase
1818
{
19-
/** @var \SimpleSAML\Configuration */
20-
protected $config;
19+
protected Configuration $config;
2120

22-
/** @var string $root_directory */
23-
protected $root_directory;
21+
protected string $root_directory;
2422

25-
/** @var string $cert_directory */
26-
protected $cert_directory = 'certificates/rsa-pem';
23+
protected string $cert_directory = 'certificates/rsa-pem';
2724

28-
/** @var string $ca_private_key_file */
29-
protected $ca_private_key_file = 'simplesamlphp.org-ca_nopasswd.key';
25+
protected string $ca_private_key_file = 'simplesamlphp.org-ca_nopasswd.key';
3026

31-
/** @var string $ca_certificate_file */
32-
protected $ca_certificate_file = 'simplesamlphp.org-ca.crt';
27+
protected string $ca_certificate_file = 'simplesamlphp.org-ca.crt';
3328

34-
/** @var string $good_private_key_file */
35-
protected $good_private_key_file = 'signed.simplesamlphp.org_nopasswd.key';
29+
protected string $good_private_key_file = 'signed.simplesamlphp.org_nopasswd.key';
3630

37-
/** @var string $good_certificate_file */
38-
protected $good_certificate_file = 'signed.simplesamlphp.org.crt';
31+
protected string $good_certificate_file = 'signed.simplesamlphp.org.crt';
3932

4033
// openssl genrsa -out example.org-ca.key 1024
41-
/** @var string $ca_private_key */
42-
protected $ca_private_key;
34+
protected string $ca_private_key;
4335

4436
// openssl req -key example.org-ca.key -new -x509 -days 36500 -out example.org-ca.crt
45-
/** @var string $ca_certificate */
46-
protected $ca_certificate;
37+
protected string $ca_certificate;
4738

4839
// openssl genrsa -out signed.example.org.key 1024
49-
/** @var string $good_private_key */
50-
protected $good_private_key;
40+
protected string $good_private_key;
5141

5242
// openssl req -key signed.example.org.key -new -out signed.example.org.crt
53-
/** @var string $good_certificate */
54-
protected $good_certificate;
43+
protected string $good_certificate;
5544

5645

5746
/**
@@ -69,7 +58,6 @@ public function __construct()
6958

7059

7160
/**
72-
* @return array
7361
*/
7462
public function getCertDirContent(): array
7563
{
@@ -83,7 +71,6 @@ public function getCertDirContent(): array
8371

8472

8573
/**
86-
* @return void
8774
*/
8875
public function setUp(): void
8976
{
@@ -94,7 +81,6 @@ public function setUp(): void
9481

9582

9683
/**
97-
* @return void
9884
*/
9985
public function tearDown(): void
10086
{
@@ -106,7 +92,6 @@ public function tearDown(): void
10692
* @param \SimpleSAML\Configuration $service
10793
* @param class-string $className
10894
* @param mixed|null $value
109-
* @return void
11095
*/
11196
protected function clearInstance(Configuration $service, string $className, $value = null): void
11297
{

lib/SimpleTestLogger.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
final class SimpleTestLogger extends AbstractLogger
1919
{
2020
/**
21-
* @var array
2221
*/
2322
private array $messages = [];
2423

@@ -27,8 +26,6 @@ final class SimpleTestLogger extends AbstractLogger
2726
* @param mixed $level
2827
* @param string|\Stringable $message
2928
* @param mixed[] $context
30-
*
31-
* @return void
3229
*/
3330
public function log($level, string|Stringable $message, array $context = []): void
3431
{
@@ -44,8 +41,6 @@ public function log($level, string|Stringable $message, array $context = []): vo
4441
* Get all the messages logged at the specified level
4542
*
4643
* @param mixed $level
47-
*
48-
* @return array
4944
*/
5045
public function getMessagesForLevel($level): array
5146
{
@@ -59,8 +54,6 @@ public function getMessagesForLevel($level): array
5954
* Check if the given message exists within the log
6055
*
6156
* @param string|\Stringable $messageToFind
62-
*
63-
* @return bool
6457
*/
6558
public function hasMessage(string|Stringable $messageToFind): bool
6659
{

0 commit comments

Comments
 (0)