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

Car   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setSeatsNumber() 0 6 1
A createFromInput() 0 9 1
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