HeaderMap::allowMultiple()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Tebru\Retrofit\Annotation;
6
7
use Tebru\Retrofit\StringConverter;
8
9
/**
10
 * Represents a collection of @Header annotations
11
 *
12
 * The default value specifies the variable name in the method signature.
13
 *
14
 * Any iterable may be passed as an argument. Keys of the map will be the header
15
 * names, and the values will be handled exactly the same as as @Header.
16
 *
17
 * @author Nate Brunette <[email protected]>
18
 *
19
 * @Annotation
20
 * @Target({"CLASS", "METHOD"})
21
 */
22
class HeaderMap extends ParameterAnnotation
23
{
24
    /**
25
     * Return the converter interface class
26
     *
27
     * Can be one of RequestBodyConverter, ResponseBodyConverter, or StringConverter
28
     *
29
     * @return string
30
     */
31 4
    public function converterType(): ?string
32
    {
33 4
        return StringConverter::class;
34
    }
35
36
    /**
37
     * Returns true if multiple annotations of this type are allowed
38
     *
39
     * @return bool
40
     */
41 4
    public function allowMultiple(): bool
42
    {
43 4
        return true;
44
    }
45
}
46