Completed
Push — master ( ad254d...4dd779 )
by Sergey
03:29
created

Cards   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getAll() 0 4 1
A delete() 0 10 1
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 Cards extends Endpoint
9
{
10
11
    use BelongsToOrganization, CrudEndpoint;
12
13
    /**
14
     * @var string
15
     */
16
    protected $endpoint = 'cards';
17
18
    /**
19
     * @param string $widgetCommonId
20
     * @return mixed
21
     */
22
    public function getAll($widgetCommonId)
23
    {
24
        return parent::getAll(['widgetCommonId'=>$widgetCommonId]);
25
    }
26
27
    /**
28
     * @param string $cardId
29
     * @param bool $everywhere
30
     * @return mixed
31
     */
32
    public function delete($cardId, $everywhere)
33
    {
34
        return $this
35
            ->getHttp()
36
            ->delete(
37
                $this->makeRequestUrl($cardId),
38
                ['everywhere' => $everywhere],
39
                $this->getHeaders()
40
            );
41
    }
42
}