EditTeacher::getMethod()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
namespace mikemix\Wiziq\API\Request;
3
4
use mikemix\Wiziq\Common\Api\RequestInterface;
5
use mikemix\Wiziq\Entity\Teacher;
6
7
class EditTeacher implements RequestInterface
8
{
9
    /** @var int */
10
    private $teacherId;
11
12
    /** @var Teacher */
13
    private $teacher;
14
15 3
    public function __construct($teacherId, Teacher $teacher)
16
    {
17 3
        $this->teacherId = (int)$teacherId;
18 3
        $this->teacher   = $teacher;
19 3
    }
20
21
    /**
22
     * {@inheritdoc}
23
     */
24 1
    public function getMethod()
25
    {
26 1
        return 'edit_teacher';
27
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32 1
    public function getParams()
33
    {
34 1
        return array_merge(['teacher_id' => $this->teacherId], $this->teacher->toArray());
35
    }
36
}
37