| Total Complexity | 2 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class PCBuilder implements BuilderInterface |
||
| 15 | { |
||
| 16 | private array $components; |
||
| 17 | |||
| 18 | public function createComputer(): ComputerInterface |
||
| 19 | { |
||
| 20 | $this |
||
| 21 | ->setPart(new Hardware\Motherboard(Order::MB)) |
||
| 22 | ->setPart(new Hardware\Cpu(Order::CPU)) |
||
| 23 | ->setPart(new Hardware\Ram(Order::RAM)) |
||
| 24 | ->setPart(new Hardware\Gpu(Order::GPU)) |
||
| 25 | ->setPart(new Hardware\Ssd(Order::SSD)) |
||
| 26 | ->setPart(new Hardware\Hdd(Order::HDD)); |
||
| 27 | |||
| 28 | return new Desktop($this->components); |
||
| 29 | } |
||
| 30 | |||
| 31 | private function setPart(AbstractPart $part): BuilderInterface |
||
| 35 | } |
||
| 36 | } |
||
| 37 |