Header   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 25
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A allowMultiple() 0 4 1
A converterType() 0 4 1
1
<?php
2
/*
3
 * Copyright (c) Nate Brunette.
4
 * Distributed under the MIT License (http://opensource.org/licenses/MIT)
5
 */
6
7
declare(strict_types=1);
8
9
namespace Tebru\Retrofit\Annotation;
10
11
use Tebru\Retrofit\StringConverter;
12
13
/**
14
 * Adds a header to request
15
 *
16
 * The default value represents the header name. Passing an array will add a new value for each
17
 * header name.
18
 *
19
 * @author Nate Brunette <[email protected]>
20
 *
21
 * @Annotation
22
 * @Target({"CLASS", "METHOD"})
23
 */
24
class Header extends ParameterAnnotation
25
{
26
    /**
27
     * Whether or not multiple annotations of this type can
28
     * be added to a method
29
     *
30
     * @return bool
31
     */
32 1
    public function allowMultiple(): bool
33
    {
34 1
        return true;
35
    }
36
37
    /**
38
     * Return the converter interface class
39
     *
40
     * Can be one of RequestBodyConverter, ResponseBodyConverter, or StringConverter
41
     *
42
     * @return string
43
     */
44 1
    public function converterType(): ?string
45
    {
46 1
        return StringConverter::class;
47
    }
48
}
49