ReceivedDocumentPaymentExported::getUri()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
dl 8
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Fousky\Component\iDoklad\Functions\ReceivedDocumentPayments;
4
5
use Fousky\Component\iDoklad\Functions\iDokladAbstractFunction;
6
use Fousky\Component\iDoklad\LOV\ExportedStateEnum;
7
use Fousky\Component\iDoklad\Model\Void\BooleanModel;
8
9
/**
10
 * @see https://app.idoklad.cz/developer/Help/v2/cs/Api?apiId=PUT-api-v2-ReceivedDocumentPayments-id-Exported-exported
11
 *
12
 * @author Lukáš Brzák <[email protected]>
13
 */
14 View Code Duplication
class ReceivedDocumentPaymentExported extends iDokladAbstractFunction
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
15
{
16
    /** @var string $id */
17
    protected $id;
18
19
    /** @var int $exported */
20
    protected $exported;
21
22
    /**
23
     * @param string            $id
24
     * @param ExportedStateEnum $exported
25
     */
26
    public function __construct(string $id, ExportedStateEnum $exported)
27
    {
28
        $this->id = $id;
29
        $this->exported = $exported->getValue();
30
    }
31
32
    /**
33
     * Get iDokladModelInterface class.
34
     *
35
     * @see iDokladModelInterface
36
     *
37
     * @return string
38
     */
39
    public function getModelClass(): string
40
    {
41
        return BooleanModel::class;
42
    }
43
44
    /**
45
     * GET|POST|PUT|DELETE e.g.
46
     *
47
     * @see iDoklad::request()
48
     *
49
     * @return string
50
     */
51
    public function getHttpMethod(): string
52
    {
53
        return 'PUT';
54
    }
55
56
    /**
57
     * Return base URI, e.g. /invoices; /invoice/1/edit and so on.
58
     *
59
     * @see iDoklad::call()
60
     *
61
     * @return string
62
     */
63
    public function getUri(): string
64
    {
65
        return sprintf(
66
            'ReceivedDocumentPayments/%s/Exported/%s',
67
            $this->id,
68
            $this->exported
69
        );
70
    }
71
72
    /**
73
     * Vrátí seznam parametrů, které se předají GuzzleHttp\Client.
74
     *
75
     * @see \GuzzleHttp\Client::request()
76
     * @see iDoklad::call()
77
     *
78
     * @return array
79
     */
80
    public function getGuzzleOptions(): array
81
    {
82
        return [];
83
    }
84
}
85