Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
AttributeMultiValue
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
2 / 2
3
100.00% covered (success)
100.00%
1 / 1
 confirmParameterCount
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
2
 getValue
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3/**
4 * @author: Doug Wilbourne (dougwilbourne@gmail.com)
5 */
6declare(strict_types=1);
7
8namespace pvc\html\attribute;
9
10use pvc\html\err\InvalidNumberOfAttributeValuesException;
11use pvc\interfaces\html\attribute\AttributeInterface;
12use pvc\interfaces\html\attribute\AttributeWithValueInterface;
13
14/**
15 * Class AttributeMultiValue
16 * @phpstan-import-type ValueType from AttributeWithValueInterface
17 */
18class AttributeMultiValue extends AttributeWithValue
19{
20
21    /**
22     * @param  array<ValueType>  $values
23     *
24     * @return Void
25     * @throws InvalidNumberOfAttributeValuesException
26     */
27    protected function confirmParameterCount(array $values): void
28    {
29        if (count($values) < 1) {
30            throw new InvalidNumberOfAttributeValuesException('>=1');
31        }
32    }
33
34    /**
35     * @return array<ValueType>
36     */
37    public function getValue()
38    {
39        return $this->values;
40    }
41}