This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
19
{
20
$input = $argument->offsetGet('input');
21
22
return new CarInput(
23
AppGlobalId::getIdFromGlobalId($input['id']),
24
$input['manufacturer'],
25
$input['model'],
26
$input['seats_number']
27
);
28
}
29
30
/**
31
* @param CarInput $input
32
* @return Car
33
*/
34
public static function createCar(CarInput $input): Car
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
49
{
50
$input = $argument->offsetGet('input');
51
52
return new TruckInput(
53
AppGlobalId::getIdFromGlobalId($input['id']),
54
$input['manufacturer'],
55
$input['model'],
56
$input['maximum_load']
57
);
58
}
59
60
/**
61
* @param TruckInput $input
62
* @return Truck
63
*/
64
public static function createTruck(TruckInput $input): Truck
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.