Completed
Pull Request — master (#6)
by Sergey
02:54
created

Me   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A info() 0 4 1
A inSearch() 0 4 1
A editName() 0 9 1
1
<?php
2
3
namespace seregazhuk\HeadHunterApi\EndPoints;
4
5
class Me extends Endpoint
6
{
7
    const RESOURCE = 'me';
8
9
    public function info()
10
    {
11
        return $this->request->get(self::RESOURCE);
12
    }
13
14
    /**
15
     * @param bool $val
16
     */
17
    public function inSearch($val = true)
18
    {
19
        $this->request->post(self::RESOURCE, ['is_in_search'=>$val]);
20
    }
21
22
    /**
23
     * @param string $lastName
24
     * @param string $firstName
25
     * @param string $middleName
26
     */ 
27
    public function editName($lastName, $firstName, $middleName)
28
    {
29
        $data = [
30
            'last_name'   => $lastName,
31
            'first_name'  => $firstName,
32
            'middle_name' => $middleName
33
        ];
34
        $this->request->post(self::RESOURCE, $data);
35
    }
36
37
}
38