Code Duplication    Length = 24-24 lines in 2 locations

src/Structural/Bridge/Bus.php 1 location

@@ 10-33 (lines=24) @@
7
 * Class Bus
8
 * @package codenixsv\Patterns\Structural\Bridge
9
 */
10
class Bus implements VehicleInterface
11
{
12
    /**
13
     * @var EngineInterface
14
     */
15
    private $engine;
16
17
    /**
18
     * VehicleInterface constructor.
19
     * @param EngineInterface $engine
20
     */
21
    public function __construct(EngineInterface $engine)
22
    {
23
        $this->engine = $engine;
24
    }
25
26
    /**
27
     * @return string
28
     */
29
    public function getDescription(): string
30
    {
31
        return 'Bus with ' . $this->engine->getEngineType() . ' engine';
32
    }
33
}
34

src/Structural/Bridge/Car.php 1 location

@@ 10-33 (lines=24) @@
7
 * Class Car
8
 * @package codenixsv\Patterns\Structural\Bridge
9
 */
10
class Car implements VehicleInterface
11
{
12
    /**
13
     * @var EngineInterface
14
     */
15
    private $engine;
16
17
    /**
18
     * VehicleInterface constructor.
19
     * @param EngineInterface $engine
20
     */
21
    public function __construct(EngineInterface $engine)
22
    {
23
        $this->engine = $engine;
24
    }
25
26
    /**
27
     * @return string
28
     */
29
    public function getDescription(): string
30
    {
31
        return 'Car with ' . $this->engine->getEngineType() . ' engine';
32
    }
33
}
34