EditTeacher   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 30
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getMethod() 0 4 1
A getParams() 0 4 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