Completed
Pull Request — master (#3)
by Samuel
01:48
created

Car::getSeatsNumber()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Vehicle\Domain;
4
5
use App\Vehicle\Domain\Input\CarInput;
6
7
class Car extends CarInput
8
{
9
    /**
10
     * @param int $seatsNumber
11
     * @return Car
12
     */
13
    public function setSeatsNumber(int $seatsNumber): Car
14
    {
15
        $this->seatsNumber = $seatsNumber;
16
17
        return $this;
18
    }
19
20
    /**
21
     * @param CarInput $input
22
     * @return Car
23
     */
24
    public static function createFromInput(CarInput $input): Car
25
    {
26
        return new self(
27
            $input->getId(),
28
            $input->getManufacturer(),
29
            $input->getModel(),
30
            $input->getSeatsNumber()
31
        );
32
    }
33
}
34