Skip to content

Commit 5fa57da

Browse files
committed
Use short name for Constants class
Signed-off-by: Jaime Pérez <jaimepc@gmail.com>
1 parent df435c2 commit 5fa57da

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/XML/SignableElementTrait.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use DOMNode;
99
use SimpleSAML\Assert\Assert;
1010
use SimpleSAML\XMLSecurity\Alg\SignatureAlgorithm;
11-
use SimpleSAML\XMLSecurity\Constants;
11+
use SimpleSAML\XMLSecurity\Constants as C;
1212
use SimpleSAML\XMLSecurity\Exception\InvalidArgumentException;
1313
use SimpleSAML\XMLSecurity\Exception\RuntimeException;
1414
use SimpleSAML\XMLSecurity\Utils\Security;
@@ -38,7 +38,7 @@ trait SignableElementTrait
3838
protected ?Signature $signature = null;
3939

4040
/** @var string */
41-
private string $c14nAlg = Constants::C14N_EXCLUSIVE_WITHOUT_COMMENTS;
41+
private string $c14nAlg = C::C14N_EXCLUSIVE_WITHOUT_COMMENTS;
4242

4343
/** @var \SimpleSAML\XMLSecurity\XML\ds\KeyInfo|null */
4444
private ?KeyInfo $keyInfo = null;
@@ -68,18 +68,18 @@ abstract public function getId(): ?string;
6868
*/
6969
public function sign(
7070
SignatureAlgorithm $signer,
71-
string $canonicalizationAlg = Constants::C14N_EXCLUSIVE_WITHOUT_COMMENTS,
71+
string $canonicalizationAlg = C::C14N_EXCLUSIVE_WITHOUT_COMMENTS,
7272
?KeyInfo $keyInfo = null
7373
): void {
7474
$this->signer = $signer;
7575
$this->keyInfo = $keyInfo;
7676
Assert::oneOf(
7777
$canonicalizationAlg,
7878
[
79-
Constants::C14N_INCLUSIVE_WITH_COMMENTS,
80-
Constants::C14N_EXCLUSIVE_WITHOUT_COMMENTS,
81-
Constants::C14N_EXCLUSIVE_WITH_COMMENTS,
82-
Constants::C14N_EXCLUSIVE_WITHOUT_COMMENTS
79+
C::C14N_INCLUSIVE_WITH_COMMENTS,
80+
C::C14N_EXCLUSIVE_WITHOUT_COMMENTS,
81+
C::C14N_EXCLUSIVE_WITH_COMMENTS,
82+
C::C14N_EXCLUSIVE_WITHOUT_COMMENTS
8383
],
8484
'Unsupported canonicalization algorithm',
8585
InvalidArgumentException::class
@@ -104,7 +104,7 @@ private function doSign(DOMElement $xml): void
104104
$digest = $this->signer->getDigest();
105105

106106
$transforms = new Transforms([
107-
new Transform(Constants::XMLDSIG_ENVELOPED),
107+
new Transform(C::XMLDSIG_ENVELOPED),
108108
new Transform($this->c14nAlg)
109109
]);
110110

0 commit comments

Comments
 (0)