Skip to content

Commit 8c6c025

Browse files
committed
Refactor saml:EncryptedElementType
1 parent 3a53d6a commit 8c6c025

File tree

4 files changed

+21
-15
lines changed

4 files changed

+21
-15
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace SimpleSAML\SAML2\XML\saml;
6+
7+
use SimpleSAML\SAML2\XML\EncryptedElementTrait;
8+
use SimpleSAML\XMLSecurity\XML\EncryptedElementInterface;
9+
10+
/**
11+
* Class representing an encrypted element.
12+
*
13+
* @package simplesamlphp/saml2
14+
*/
15+
abstract class AbstractEncryptedElement extends AbstractSamlElement implements EncryptedElementInterface
16+
{
17+
use EncryptedElementTrait;
18+
}

src/XML/saml/EncryptedAssertion.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,19 @@
44

55
namespace SimpleSAML\SAML2\XML\saml;
66

7-
use SimpleSAML\SAML2\XML\EncryptedElementTrait;
87
use SimpleSAML\XML\DOMDocumentFactory;
98
use SimpleSAML\XML\SchemaValidatableElementInterface;
109
use SimpleSAML\XML\SchemaValidatableElementTrait;
1110
use SimpleSAML\XMLSecurity\Alg\Encryption\EncryptionAlgorithmInterface;
12-
use SimpleSAML\XMLSecurity\XML\EncryptedElementInterface;
1311

1412
/**
1513
* Class handling encrypted assertions.
1614
*
1715
* @package simplesamlphp/saml2
1816
*/
19-
final class EncryptedAssertion extends AbstractSamlElement implements
20-
EncryptedElementInterface,
17+
final class EncryptedAssertion extends AbstractEncryptedElement implements
2118
SchemaValidatableElementInterface
2219
{
23-
use EncryptedElementTrait;
2420
use SchemaValidatableElementTrait;
2521

2622

src/XML/saml/EncryptedAttribute.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,19 @@
44

55
namespace SimpleSAML\SAML2\XML\saml;
66

7-
use SimpleSAML\SAML2\XML\EncryptedElementTrait;
87
use SimpleSAML\XML\DOMDocumentFactory;
98
use SimpleSAML\XML\SchemaValidatableElementInterface;
109
use SimpleSAML\XML\SchemaValidatableElementTrait;
1110
use SimpleSAML\XMLSecurity\Alg\Encryption\EncryptionAlgorithmInterface;
12-
use SimpleSAML\XMLSecurity\XML\EncryptedElementInterface;
1311

1412
/**
1513
* Class handling encrypted attributes.
1614
*
1715
* @package simplesamlphp/saml2
1816
*/
19-
class EncryptedAttribute extends AbstractSamlElement implements
20-
EncryptedElementInterface,
17+
final class EncryptedAttribute extends AbstractEncryptedElement implements
2118
SchemaValidatableElementInterface
2219
{
23-
use EncryptedElementTrait;
2420
use SchemaValidatableElementTrait;
2521

2622

src/XML/saml/EncryptedID.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
namespace SimpleSAML\SAML2\XML\saml;
66

77
use InvalidArgumentException;
8-
use SimpleSAML\SAML2\XML\EncryptedElementTrait;
98
use SimpleSAML\XML\DOMDocumentFactory;
109
use SimpleSAML\XML\SchemaValidatableElementInterface;
1110
use SimpleSAML\XML\SchemaValidatableElementTrait;
1211
use SimpleSAML\XML\SerializableElementInterface;
1312
use SimpleSAML\XMLSecurity\Alg\Encryption\EncryptionAlgorithmInterface;
14-
use SimpleSAML\XMLSecurity\XML\EncryptedElementInterface;
1513

1614
use function implode;
1715

@@ -20,12 +18,10 @@
2018
*
2119
* @package simplesamlphp/saml2
2220
*/
23-
class EncryptedID extends AbstractSamlElement implements
24-
EncryptedElementInterface,
21+
final class EncryptedID extends AbstractEncryptedElement implements
2522
IdentifierInterface,
2623
SchemaValidatableElementInterface
2724
{
28-
use EncryptedElementTrait;
2925
use SchemaValidatableElementTrait;
3026

3127

0 commit comments

Comments
 (0)