Widgets::delete()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 8
nc 2
nop 2
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