Widgets::endpoint()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace seregazhuk\Favro\Api\Endpoints;
4
5
class Widgets extends CrudEndpoint
6
{
7
    /**
8
     * @param string $itemId
9
     * @param string|null $collectionId
10
     * @return mixed
11
     */
12
    public function delete($itemId, $collectionId = null)
13
    {
14
        $attributes = $collectionId ? ['collectionId' => $collectionId] : [];
15
16
        return $this
17
            ->http
18
            ->delete(
19
                $this->makeRequestUrl($itemId),
20
                $attributes,
21
                $this->headers()
22
            );
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function endpoint()
29
    {
30
        return 'widgets';
31
    }
32
}
33