function __construct($label, \MyTransport\Fare\IFare $fare = NULL) { parent::__construct(4, $label, 60, 70, 30, $fare); if ($this->fare->type == "Fixed") { $this->fare->setCost(12); } elseif ($this->fare->type == "Distance") { $this->fare->setCost(3); } }
function __construct($label, \MyTransport\Fare\IFare $fare = NULL) { parent::__construct(2, $label, 15, 20, 1, $fare); if ($this->fare->type == "Fixed") { $this->fare->setCost(1000); } elseif ($this->fare->type == "Distance") { $this->fare->setCost(8); } }
public function __construct(Engine $engine, $colour = Vehicle::UNPAINTED) { parent::__construct($engine, $colour); // Starts in standard gearbox mode (more economical) $this->gearboxStrategy = new StandardGearboxStrategy(); }
public function __construct(Engine $engine, $colour = Vehicle::UNPAINTED) { parent::__construct($engine, $colour); }
public function __construct(Vehicle $vehicle) { parent::__construct($vehicle->getEngine(), $vehicle->getColour()); $this->decoratedVehicle = $vehicle; }