KeyCollection   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A add() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\Certificate;
6
7
use SimpleSAML\SAML2\Assert\Assert;
8
use SimpleSAML\SAML2\Utilities\ArrayCollection;
9
10
/**
11
 * Simple collection object for transporting keys
12
 */
13
class KeyCollection extends ArrayCollection
14
{
15
    /**
16
     * Add a key to the collection
17
     *
18
     * @param \SimpleSAML\SAML2\Certificate\Key $element
19
     *
20
     * @throws \SimpleSAML\Assert\AssertionFailedException if assertions are false
21
     */
22
    public function add($element): void
23
    {
24
        Assert::isInstanceOf($element, Key::class);
25
        parent::add($element);
26
    }
27
}
28