Completed
Push — master ( f011eb...9572b6 )
by Sergey
03:28
created

Widgets   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 5
Bugs 1 Features 1
Metric Value
wmc 2
c 5
b 1
f 1
lcom 1
cbo 4
dl 0
loc 28
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A delete() 0 12 2
1
<?php
2
3
namespace seregazhuk\Favro\Api\Endpoints;
4
5
use seregazhuk\Favro\Api\Endpoints\Traits\CrudEndpoint;
6
use seregazhuk\Favro\Api\Endpoints\Traits\BelongsToOrganization;
7
8
class Widgets extends Endpoint
9
{
10
11
    use BelongsToOrganization, CrudEndpoint;
12
13
    /**
14
     * @var string
15
     */
16
    protected $endpoint = 'widgets';
17
18
    /**
19
     * @param string $itemId
20
     * @param string|null $collectionId
21
     * @return mixed
22
     */
23
    public function delete($itemId, $collectionId = null)
24
    {
25
        $attributes = $collectionId ? ['collectionId' => $collectionId] : [];
26
27
        return $this
28
            ->getHttp()
29
            ->delete(
30
                $this->makeRequestUrl($itemId),
31
                $attributes,
32
                $this->getHeaders()
33
            );
34
    }
35
}