Skip to content

Commit e521730

Browse files
committed
Typed constants
1 parent e85faf4 commit e521730

File tree

163 files changed

+227
-529
lines changed

Some content is hidden

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

163 files changed

+227
-529
lines changed

src/Alg/Encryption/AbstractEncryptor.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
*/
1818
abstract class AbstractEncryptor implements EncryptionAlgorithmInterface
1919
{
20-
/** @var string */
21-
protected const DEFAULT_BACKEND = Backend\OpenSSL::class;
20+
protected const string DEFAULT_BACKEND = Backend\OpenSSL::class;
2221

2322

2423
/** @var \SimpleSAML\XMLSecurity\Backend\EncryptionBackend */
@@ -54,7 +53,6 @@ public function __construct(
5453

5554

5655
/**
57-
* @return string
5856
*/
5957
public function getAlgorithmId(): string
6058
{

src/Alg/Encryption/EncryptionAlgorithmFactory.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ final class EncryptionAlgorithmFactory
2727
*
2828
* @var string[]
2929
*/
30-
public const DEFAULT_BLACKLIST = [
30+
public const array DEFAULT_BLACKLIST = [
3131
C::BLOCK_ENC_3DES,
3232
];
3333

@@ -36,7 +36,7 @@ final class EncryptionAlgorithmFactory
3636
*
3737
* @var class-string[]
3838
*/
39-
private const SUPPORTED_DEFAULTS = [
39+
private const array SUPPORTED_DEFAULTS = [
4040
TripleDES::class,
4141
AES::class,
4242
];
@@ -51,8 +51,6 @@ final class EncryptionAlgorithmFactory
5151

5252
/**
5353
* Whether the factory has been initialized or not.
54-
*
55-
* @var bool
5654
*/
5755
protected static bool $initialized = false;
5856

src/Alg/KeyTransport/AbstractKeyTransporter.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
*/
1818
abstract class AbstractKeyTransporter implements KeyTransportAlgorithmInterface
1919
{
20-
/** @var string */
21-
protected const DEFAULT_BACKEND = Backend\OpenSSL::class;
20+
protected const string DEFAULT_BACKEND = Backend\OpenSSL::class;
2221

2322

2423
/** @var \SimpleSAML\XMLSecurity\Backend\EncryptionBackend */
@@ -54,7 +53,6 @@ public function __construct(
5453

5554

5655
/**
57-
* @return string
5856
*/
5957
public function getAlgorithmId(): string
6058
{

src/Alg/KeyTransport/KeyTransportAlgorithmFactory.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class KeyTransportAlgorithmFactory
2525
*
2626
* @var string[]
2727
*/
28-
public const DEFAULT_BLACKLIST = [
28+
public const array DEFAULT_BLACKLIST = [
2929
C::KEY_TRANSPORT_RSA_1_5,
3030
];
3131

@@ -34,7 +34,7 @@ class KeyTransportAlgorithmFactory
3434
*
3535
* @var class-string[]
3636
*/
37-
private const SUPPORTED_DEFAULTS = [
37+
private const array SUPPORTED_DEFAULTS = [
3838
RSA::class,
3939
];
4040

@@ -48,8 +48,6 @@ class KeyTransportAlgorithmFactory
4848

4949
/**
5050
* Whether the factory has been initialized or not.
51-
*
52-
* @var bool
5351
*/
5452
protected static bool $initialized = false;
5553

src/Alg/Signature/AbstractSigner.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
*/
1818
abstract class AbstractSigner implements SignatureAlgorithmInterface
1919
{
20-
/** @var string */
21-
protected const DEFAULT_BACKEND = Backend\OpenSSL::class;
20+
protected const string DEFAULT_BACKEND = Backend\OpenSSL::class;
2221

2322

2423
/** @var \SimpleSAML\XMLSecurity\Backend\SignatureBackend */
@@ -57,7 +56,6 @@ public function __construct(
5756

5857

5958
/**
60-
* @return string
6159
*/
6260
public function getAlgorithmId(): string
6361
{
@@ -66,7 +64,6 @@ public function getAlgorithmId(): string
6664

6765

6866
/**
69-
* @return string
7067
*/
7168
public function getDigest(): string
7269
{

src/Alg/Signature/HMAC.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
*/
1616
final class HMAC extends AbstractSigner implements SignatureAlgorithmInterface
1717
{
18-
/** @var string */
19-
protected const DEFAULT_BACKEND = Backend\HMAC::class;
18+
protected const string DEFAULT_BACKEND = Backend\HMAC::class;
2019

2120

2221
/**

src/Alg/Signature/SignatureAlgorithmFactory.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ final class SignatureAlgorithmFactory
2727
*
2828
* @var string[]
2929
*/
30-
public const DEFAULT_BLACKLIST = [
30+
public const array DEFAULT_BLACKLIST = [
3131
C::SIG_RSA_SHA1,
3232
C::SIG_HMAC_SHA1,
3333
];
@@ -37,7 +37,7 @@ final class SignatureAlgorithmFactory
3737
*
3838
* @var class-string[]
3939
*/
40-
private const SUPPORTED_DEFAULTS = [
40+
private const array SUPPORTED_DEFAULTS = [
4141
RSA::class,
4242
HMAC::class,
4343
];
@@ -52,8 +52,6 @@ final class SignatureAlgorithmFactory
5252

5353
/**
5454
* Whether the factory has been initialized or not.
55-
*
56-
* @var bool
5755
*/
5856
protected static bool $initialized = false;
5957

src/Assert/HMACOutputLengthTrait.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ trait HMACOutputLengthTrait
1919
* The HMAC algorithm (RFC2104 [HMAC]) takes the output (truncation) length in bits as a parameter;
2020
* this specification REQUIRES that the truncation length be a multiple of 8 (i.e. fall on a byte boundary)
2121
* because Base64 encoding operates on full bytes
22-
*
23-
* @var string
2422
*/
2523
private static string $HMACOutputLength_regex = '/^([1-9]\d*)$/D';
2624

src/Assert/KeySizeTrait.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ trait KeySizeTrait
1414
/**
1515
* The size in bits of the key to be derived from the shared secret as the UTF-8 string for the corresponding
1616
* decimal integer with only digits in the string and no leading zeros.
17-
*
18-
* @var string
1917
*/
2018
private static string $keySize_regex = '/^([1-9]\d*)$/D';
2119

src/Backend/HMAC.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
*/
2020
final class HMAC implements SignatureBackend
2121
{
22-
/** @var string */
2322
protected string $digest;
2423

2524

0 commit comments

Comments
 (0)