Passed
Pull Request — master (#9)
by mouhsine
01:45
created

Modify::getParams()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 1
b 0
f 1
cc 1
eloc 2
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\Classroom;
6
7
class Modify implements RequestInterface
8
{
9
10
    /** @var int */
11
    private $classroomId;
12
13
    /** @var Classroom */
14
    private $classroom;
15
16 3
    public function __construct($classroomId, Classroom $classroom)
17
    {
18 3
        $this->classroomId = (int)$classroomId;
19 3
        $this->classroom   = $classroom;
20 3
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25 1
    public function getMethod()
26
    {
27 1
        return 'modify';
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33 1
    public function getParams()
34
    {
35 1
        return array_merge(['class_id' => $this->classroomId], $this->classroom->toArray());
36
    }
37
}
38