Skip to content

Commit 2a51dcb

Browse files
committed
Add use-statements for builtins
1 parent 48b4d0e commit 2a51dcb

Some content is hidden

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

65 files changed

+267
-3
lines changed

src/Alg/Signature/SignatureAlgorithmFactory.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
use SimpleSAML\XMLSecurity\Key\AsymmetricKey;
1111
use SimpleSAML\XMLSecurity\Key\SymmetricKey;
1212

13+
use function in_array;
14+
1315
/**
1416
* Factory class to create and configure digital signature algorithms.
1517
*

src/Backend/HMAC.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
use SimpleSAML\XMLSecurity\Key\AbstractKey;
88
use SimpleSAML\XMLSecurity\Utils\Security;
99

10+
use function hash_hmac;
11+
1012
/**
1113
* Backend for digital signatures based on hash-based message authentication codes.
1214
*

src/Backend/OpenSSL.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@
1010
use SimpleSAML\XMLSecurity\Key\PrivateKey;
1111
use SimpleSAML\XMLSecurity\Utils\Random;
1212

13+
use function chr;
14+
use function mb_strlen;
15+
use function openssl_cipher_iv_length;
16+
use function openssl_decrypt;
17+
use function openssl_encrypt;
18+
use function openssl_error_string;
19+
use function openssl_private_decrypt;
20+
use function openssl_public_decrypt;
21+
use function openssl_private_encrypt;
22+
use function openssl_public_encrypt;
23+
use function openssl_sign;
24+
use function openssl_verify;
25+
use function ord;
26+
use function str_repeat;
27+
use function substr;
28+
1329
/**
1430
* Backend for encryption and digital signatures based on the native openssl library.
1531
*

src/Exception/InvalidArgumentException.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
use Throwable;
66

7+
use function get_class;
8+
use function gettype;
9+
use function is_object;
10+
use function sprintf;
11+
712
/**
813
* Class InvalidArgumentException
914
*

src/Key/AsymmetricKey.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
use SimpleSAML\XMLSecurity\Exception\InvalidArgumentException;
66

7+
use function file_get_contents;
8+
79
/**
810
* A class representing an asymmetric key.
911
*

src/Key/PrivateKey.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
use SimpleSAML\XMLSecurity\Exception\InvalidArgumentException;
66

7+
use function openssl_pkey_get_private;
8+
79
/**
810
* A class modeling private keys for their use in asymmetric algorithms.
911
*

src/Key/PublicKey.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44

55
use SimpleSAML\XMLSecurity\Exception\InvalidArgumentException;
66

7+
use function base64_encode;
8+
use function chr;
9+
use function chunk_split;
10+
use function openssl_pkey_get_public;
11+
use function ord;
12+
use function pack;
13+
use function sprintf;
14+
715
/**
816
* A class modeling public keys for their use in asymmetric algorithms.
917
*

src/Key/SymmetricKey.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
use SimpleSAML\XMLSecurity\Exception\RuntimeException;
66
use SimpleSAML\XMLSecurity\Utils\Random;
77

8+
use function chr;
9+
use function ord;
10+
use function strlen;
11+
812
/**
913
* A class to model symmetric key secrets.
1014
*

src/Key/X509Certificate.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@
66
use SimpleSAML\XMLSecurity\Exception\InvalidArgumentException;
77
use SimpleSAML\XMLSecurity\Exception\RuntimeException;
88

9+
use function array_map;
10+
use function array_pop;
11+
use function array_shift;
12+
use function base64_encode;
13+
use function explode;
14+
use function function_exists;
15+
use function hash;
16+
use function implode;
17+
use function openssl_error_string;
18+
use function openssl_pkey_get_public;
19+
use function openssl_x509_export;
20+
use function openssl_x509_fingerprint;
21+
use function openssl_x509_parse;
22+
use function openssl_x509_read;
23+
use function trim;
24+
925
/**
1026
* A class modeling X509 certificates.
1127
*

src/Signature.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,26 @@
1717
use SimpleSAML\XMLSecurity\Utils\Security as Sec;
1818
use SimpleSAML\XMLSecurity\Utils\XPath as XP;
1919

20+
use function array_key_exists;
21+
use function array_pop;
22+
use function array_shift;
23+
use function array_unshift;
24+
use function base64_decode;
25+
use function base64_encode;
26+
use function count;
27+
use function explode;
28+
use function get_class;
29+
use function hash;
30+
use function implode;
31+
use function in_array;
32+
use function is_array;
33+
use function is_null;
34+
use function is_string;
35+
use function join;
36+
use function parse_url;
37+
use function rtrim;
38+
use function trim;
39+
2040
/**
2141
* Class implementing XML digital signatures.
2242
*

0 commit comments

Comments
 (0)