Completed
Branch master (19b0aa)
by Nate
07:03 queued 04:40
created

Multipart::getBoundary()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/*
3
 * Copyright (c) 2015 Nate Brunette.
4
 * Distributed under the MIT License (http://opensource.org/licenses/MIT)
5
 */
6
7
namespace Tebru\Retrofit\Annotation;
8
9
use Tebru\Dynamo\Annotation\DynamoAnnotation;
10
11
/**
12
 * Indicates that the body of the request should be multipart encoded
13
 *
14
 * @author Nate Brunette <[email protected]>
15
 *
16
 * @Annotation
17
 * @Target({"CLASS", "METHOD"})
18
 */
19
class Multipart implements DynamoAnnotation
20
{
21
    const NAME = 'multipart';
22
23
    /**
24
     * If boundary is specified
25
     *
26
     * @var string
27
     */
28
    private $boundary;
29
30
    /**
31
     * Constructor
32
     *
33
     * @param array $params
34
     */
35
    public function __construct(array $params)
36
    {
37
        $this->boundary = (isset($params['boundary'])) ? $params['boundary'] : null;
38
    }
39
40
    /**
41
     * Get the boundary
42
     *
43
     * @return string
44
     */
45
    public function getBoundary()
46
    {
47
        return $this->boundary;
48
    }
49
50
    /**
51
     * The name of the annotation or class of annotations
52
     *
53
     * @return string
54
     */
55
    public function getName()
56
    {
57
        return self::NAME;
58
    }
59
60
    /**
61
     * Whether or not multiple annotations of this type can
62
     * be added to a method
63
     *
64
     * @return bool
65
     */
66
    public function allowMultiple()
67
    {
68
        return false;
69
    }
70
}
71