Skip to content

Commit

Permalink
Remove unused use-statements and order them alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Jan 11, 2024
1 parent be09b33 commit 10ea8fb
Show file tree
Hide file tree
Showing 64 changed files with 20 additions and 127 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
},
"config": {
"allow-plugins": {
"composer/package-versions-deprecated": true
"composer/package-versions-deprecated": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
1 change: 0 additions & 1 deletion src/Backend/EncryptionBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace SimpleSAML\XMLSecurity\Backend;

use SimpleSAML\XMLSecurity\Exception\InvalidArgumentException;
use SimpleSAML\XMLSecurity\Key\KeyInterface;

/**
Expand Down
6 changes: 1 addition & 5 deletions src/Backend/OpenSSL.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use SimpleSAML\XMLSecurity\Constants as C;
use SimpleSAML\XMLSecurity\Exception\InvalidArgumentException;
use SimpleSAML\XMLSecurity\Exception\RuntimeException;
use SimpleSAML\XMLSecurity\Key\KeyInterface;
use SimpleSAML\XMLSecurity\Key\AsymmetricKey;
use SimpleSAML\XMLSecurity\Key\KeyInterface;
use SimpleSAML\XMLSecurity\Key\PrivateKey;
use SimpleSAML\XMLSecurity\Utils\Random;

Expand All @@ -18,10 +18,6 @@
use function openssl_decrypt;
use function openssl_encrypt;
use function openssl_error_string;
use function openssl_private_decrypt;
use function openssl_public_decrypt;
use function openssl_private_encrypt;
use function openssl_public_encrypt;
use function openssl_sign;
use function openssl_verify;
use function ord;
Expand Down
3 changes: 1 addition & 2 deletions src/CryptoEncoding/PEMBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@
use Countable;
use IteratorAggregate;
use LogicException;
use RuntimeException;
use SimpleSAML\XMLSecurity\Exception\IOException;
use UnexpectedValueException;

use function array_map;
use function array_merge;
use function base64_decode;
use function count;
use function file_get_contents;
use function implode;
use function is_readable;
use function file_get_contents;
use function preg_match_all;
use function preg_replace;

Expand Down
1 change: 0 additions & 1 deletion src/Key/AsymmetricKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace SimpleSAML\XMLSecurity\Key;

use OpenSSLAsymmetricKey;
use SimpleSAML\XMLSecurity\CryptoEncoding\PEM;

/**
Expand Down
1 change: 0 additions & 1 deletion src/Key/PrivateKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace SimpleSAML\XMLSecurity\Key;

use OpenSSLAsymmetricKey;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XMLSecurity\CryptoEncoding\PEM;
use SimpleSAML\XMLSecurity\Exception\RuntimeException;
Expand Down
3 changes: 0 additions & 3 deletions src/Key/PublicKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@

namespace SimpleSAML\XMLSecurity\Key;

use OpenSSLAsymmetricKey;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XMLSecurity\CryptoEncoding\PEM;
use SimpleSAML\XMLSecurity\Exception\RuntimeException;

use function base64_encode;
use function chr;
use function chunk_split;
use function openssl_error_string;
use function ord;
use function pack;
use function sprintf;
Expand Down
1 change: 0 additions & 1 deletion src/Key/X509Certificate.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace SimpleSAML\XMLSecurity\Key;

use OpenSSLCertificate;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XMLSecurity\Constants as C;
use SimpleSAML\XMLSecurity\CryptoEncoding\PEM;
Expand Down
3 changes: 0 additions & 3 deletions src/TestUtils/PEMCertificatesMock.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@

namespace SimpleSAML\XMLSecurity\TestUtils;

use Exception;
use SimpleSAML\XMLSecurity\Key\PrivateKey;
use SimpleSAML\XMLSecurity\Key\PublicKey;
use SimpleSAML\XMLSecurity\Key\X509Certificate;
use SimpleSAML\XMLSecurity\Utils\Certificate as CertificateUtils;

use function dirname;
use function file_get_contents;
use function preg_match;
use function preg_replace;
use function trim;

/**
Expand Down
7 changes: 1 addition & 6 deletions src/TestUtils/SignedElementTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,15 @@
namespace SimpleSAML\XMLSecurity\TestUtils;

use DOMDocument;
use Exception;
use SimpleSAML\XMLSecurity\Alg\Signature\SignatureAlgorithmFactory;
use SimpleSAML\XMLSecurity\Constants as C;
use SimpleSAML\XMLSecurity\Exception\InvalidArgumentException;
use SimpleSAML\XMLSecurity\Exception\NoSignatureFoundException;
use SimpleSAML\XMLSecurity\Exception\SignatureVerificationFailedException;
use SimpleSAML\XMLSecurity\Exception\UnsupportedAlgorithmException;
use SimpleSAML\XMLSecurity\Key\PrivateKey;
use SimpleSAML\XMLSecurity\Key\X509Certificate as X509;
use SimpleSAML\XMLSecurity\TestUtils\PEMCertificatesMock;
use SimpleSAML\XMLSecurity\XML\ds\KeyInfo;
use SimpleSAML\XMLSecurity\XML\ds\X509Certificate;
use SimpleSAML\XMLSecurity\XML\ds\X509Data;
use SimpleSAML\XMLSecurity\TestUtils\PEMCertificatesMock;
use SimpleSAML\XMLSecurity\Utils\Certificate as CertificateUtils;

use function array_keys;
use function boolval;
Expand Down
2 changes: 0 additions & 2 deletions src/Utils/Random.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
use SimpleSAML\XMLSecurity\Exception\InvalidArgumentException;
use SimpleSAML\XMLSecurity\Exception\RuntimeException;

use function bin2hex;
use function random_bytes;
use function substr;

/**
* A collection of utilities to generate cryptographically-secure random data.
Expand Down
1 change: 0 additions & 1 deletion src/XML/SignableElementTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use SimpleSAML\XML\DOMDocumentFactory;
use SimpleSAML\XMLSecurity\Alg\Signature\SignatureAlgorithmInterface;
use SimpleSAML\XMLSecurity\Constants as C;
use SimpleSAML\XMLSecurity\Exception\InvalidArgumentException;
use SimpleSAML\XMLSecurity\Exception\RuntimeException;
use SimpleSAML\XMLSecurity\Exception\UnsupportedAlgorithmException;
use SimpleSAML\XMLSecurity\Utils\Security;
Expand Down
2 changes: 1 addition & 1 deletion src/XML/SignedElementTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
use SimpleSAML\XMLSecurity\Exception\ReferenceValidationFailedException;
use SimpleSAML\XMLSecurity\Exception\RuntimeException;
use SimpleSAML\XMLSecurity\Exception\SignatureVerificationFailedException;
use SimpleSAML\XMLSecurity\Key\KeyInterface;
use SimpleSAML\XMLSecurity\Key;
use SimpleSAML\XMLSecurity\Key\KeyInterface;
use SimpleSAML\XMLSecurity\Utils\Security;
use SimpleSAML\XMLSecurity\Utils\XML;
use SimpleSAML\XMLSecurity\Utils\XPath;
Expand Down
3 changes: 1 addition & 2 deletions src/XML/ds/DsObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Chunk;
use SimpleSAML\XML\XsNamespace as NS;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XMLSecurity\Exception\InvalidArgumentException;
use SimpleSAML\XML\XsNamespace as NS;

/**
* Class representing a ds:Object element.
Expand Down
4 changes: 1 addition & 3 deletions src/XML/ds/KeyValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Chunk;
use SimpleSAML\XML\ElementInterface;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\MissingElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\Exception\TooManyElementsException;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\ElementInterface;
use SimpleSAML\XML\XsNamespace as NS;
use SimpleSAML\XMLSecurity\Exception\InvalidArgumentException;

/**
* Class representing a ds:KeyValue element.
Expand Down
1 change: 0 additions & 1 deletion src/XML/ds/RSAKeyValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\MissingElementException;
use SimpleSAML\XML\Exception\TooManyElementsException;
use SimpleSAML\XMLSecurity\Exception\InvalidArgumentException;

/**
* Class representing a ds:RSAKeyValue element.
Expand Down
3 changes: 0 additions & 3 deletions src/XML/ds/SignatureProperties.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@

use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Chunk;
use SimpleSAML\XML\Constants as C;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\MissingElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\SerializableElementInterface;

/**
* Class representing a ds:SignatureProperties element.
Expand Down
1 change: 0 additions & 1 deletion src/XML/ds/SignatureProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use SimpleSAML\XML\Exception\MissingElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\SerializableElementInterface;
use SimpleSAML\XML\XsNamespace as NS;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/XML/ds/SignatureValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Base64ElementTrait;
use SimpleSAML\XML\Exception\InvalidDOMElementException;

/**
* Class representing a ds:SignatureValue element.
Expand Down
1 change: 0 additions & 1 deletion src/XML/ds/X509IssuerSerial.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\MissingElementException;
use SimpleSAML\XML\Exception\TooManyElementsException;
use SimpleSAML\XML\Utils as XMLUtils;

use function array_pop;

Expand Down
1 change: 0 additions & 1 deletion src/XML/ds/X509SerialNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Constants as C;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\StringElementTrait;
Expand Down
2 changes: 0 additions & 2 deletions src/XML/ds/XPath.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
use SimpleSAML\XMLSecurity\Exception\InvalidArgumentException;
use SimpleSAML\XMLSecurity\Utils\XPath as XPathUtils;

use function str_replace;

/**
* Class implementing the XPath element.
*
Expand Down
2 changes: 0 additions & 2 deletions src/XML/dsig11/KeyInfoReference.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XMLSecurity\Constants as C;
use SimpleSAML\XMLSecurity\Exception\InvalidArgumentException;

/**
* Class representing a dsig11:KeyInfoReference element.
Expand Down
2 changes: 1 addition & 1 deletion src/XML/dsig11/X509Digest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Base64ElementTrait;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XMLSecurity\Constants as C;
use SimpleSAML\XMLSecurity\Exception\InvalidArgumentException;
use SimpleSAML\XML\Base64ElementTrait;

/**
* Class representing a dsig11:X509Digest element.
Expand Down
2 changes: 0 additions & 2 deletions src/XML/xenc/AbstractEncryptedType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XMLSecurity\XML\ds\KeyInfo;

use function count;

/**
* Abstract class representing encrypted data.
*
Expand Down
2 changes: 0 additions & 2 deletions src/XML/xenc/AbstractEncryptionMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\XsNamespace as NS;
use SimpleSAML\XMLSecurity\Constants as C;
use SimpleSAML\XMLSecurity\Exception\InvalidArgumentException;

use function array_pop;
use function sprintf;

/**
* A class implementing the xenc:AbstractEncryptionMethod element.
Expand Down
2 changes: 0 additions & 2 deletions src/XML/xenc/AbstractReference.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Chunk;
use SimpleSAML\XML\ElementInterface;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\XsNamespace as NS;
use SimpleSAML\XMLSecurity\XML\xenc\Transforms;

/**
* Abstract class representing references. No custom elements are allowed.
Expand Down
1 change: 0 additions & 1 deletion src/XML/xenc/CipherData.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use SimpleSAML\Assert\Assert;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\TooManyElementsException;
use SimpleSAML\XMLSecurity\Utils\XPath;

use function array_pop;

Expand Down
6 changes: 0 additions & 6 deletions tests/Alg/Signature/HMACSignatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,9 @@
namespace SimpleSAML\XMLSecurity\Test\Alg\Signature;

use PHPUnit\Framework\TestCase;
use SimpleSAML\XMLSecurity\Alg\Signature\HMAC;
use SimpleSAML\XMLSecurity\Alg\Signature\SignatureAlgorithmFactory;
use SimpleSAML\XMLSecurity\Constants as C;
use SimpleSAML\XMLSecurity\Key\PrivateKey;
use SimpleSAML\XMLSecurity\Key\PublicKey;
use SimpleSAML\XMLSecurity\Key\SymmetricKey;
use SimpleSAML\XMLSecurity\Key\X509Certificate;
use SimpleSAML\XMLSecurity\TestUtils\PEMCertificatesMock;
use TypeError;

use function bin2hex;
use function hex2bin;
Expand Down
4 changes: 0 additions & 4 deletions tests/Alg/Signature/RSASignatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@
namespace SimpleSAML\XMLSecurity\Test\Alg\Signature;

use PHPUnit\Framework\TestCase;
use SimpleSAML\XMLSecurity\Alg\Signature\RSA;
use SimpleSAML\XMLSecurity\Alg\Signature\SignatureAlgorithmFactory;
use SimpleSAML\XMLSecurity\Constants as C;
use SimpleSAML\XMLSecurity\Key\PrivateKey;
use SimpleSAML\XMLSecurity\Key\PublicKey;
use SimpleSAML\XMLSecurity\Key\SymmetricKey;
use SimpleSAML\XMLSecurity\Key\X509Certificate;
use SimpleSAML\XMLSecurity\TestUtils\PEMCertificatesMock;
use TypeError;

use function bin2hex;
use function hex2bin;
Expand Down
2 changes: 1 addition & 1 deletion tests/Backend/OpenSSLTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
use SimpleSAML\XMLSecurity\Key\PublicKey;
use SimpleSAML\XMLSecurity\Key\SymmetricKey;

use function dirname;
use function bin2hex;
use function dirname;
use function hex2bin;

/**
Expand Down
1 change: 0 additions & 1 deletion tests/CryptoEncoding/PEMBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use LogicException;
use PHPUnit\Framework\TestCase;
use RuntimeException;
use SimpleSAML\XMLSecurity\CryptoEncoding\PEM;
use SimpleSAML\XMLSecurity\CryptoEncoding\PEMBundle;
use SimpleSAML\XMLSecurity\Exception\IOException;
Expand Down
1 change: 0 additions & 1 deletion tests/Key/PublicKeyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use SimpleSAML\XMLSecurity\Key\PublicKey;
use SimpleSAML\XMLSecurity\TestUtils\PEMCertificatesMock;

use function file_get_contents;
use function openssl_pkey_get_details;
use function openssl_pkey_get_public;

Expand Down
3 changes: 0 additions & 3 deletions tests/Key/X509CertificateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@
namespace SimpleSAML\XMLSecurity\Test\Key;

use PHPUnit\Framework\TestCase;
use ReflectionMethod;
use SimpleSAML\XMLSecurity\Constants as C;
use SimpleSAML\XMLSecurity\CryptoEncoding\PEM;
use SimpleSAML\XMLSecurity\Exception\UnsupportedAlgorithmException;
use SimpleSAML\XMLSecurity\Key\X509Certificate;
use SimpleSAML\XMLSecurity\TestUtils\PEMCertificatesMock;

use function file_get_contents;
use function openssl_pkey_get_details;
use function openssl_pkey_get_public;
use function openssl_x509_fingerprint;
Expand Down
Loading

0 comments on commit 10ea8fb

Please sign in to comment.