Completed
Push — master ( d0fae2...75e442 )
by Sergey
04:55 queued 02:24
created

Negotiations   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A active() 0 4 1
A messages() 0 4 1
A view() 0 4 1
A message() 0 4 1
1
<?php
2
3
namespace seregazhuk\HeadHunterApi\EndPoints;
4
5
use seregazhuk\HeadHunterApi\Traits\HasAll;
6
use seregazhuk\HeadHunterApi\Traits\HasView;
7
use seregazhuk\HeadHunterApi\Traits\InvitedNegotiations;
8
9
class Negotiations extends Endpoint
10
{
11
    const RESOURCE = 'negotiations';
12
13
    use HasView, HasAll, InvitedNegotiations;
14
15
    public function active()
16
    {
17
        return $this->getResource('active');
18
    }
19
20
    /**
21
     * @param string $id
22
     * @return array
23
     */
24
    public function messages($id)
25
    {
26
        return $this->getResource($id . '/messages');
27
    }
28
29
30
    public function view($negotiationId)
31
    {
32
        return $this->getResource($negotiationId);
33
    }
34
35
    /**
36
     * @param int $id
37
     * @param string $message
38
     * @return mixed
39
     */
40
    public function message($id, $message)
41
    {
42
        return $this->postResource($id, ['message' => $message]);
43
    }
44
}