Exemple #1
0
<?php

require 'BuilderInterface.php';
require 'Director.php';
require 'Vehicle.php';
require 'Car.php';
require 'Door.php';
require 'Engine.php';
require 'FerrariBuilder.php';
$director = new Director();
$ferrari = new FerrariBuilder();
var_dump($director->build($ferrari));
<?php

include 'class.php';
$data = [new Product('choux', 1.2, 0.055), new Product('hamburger', 2.5, 0.055), new Product('voiture', 1200, 0.199)];
$director = new Director();
$bill = new CarrefourBillBuilder();
echo $director->build($bill, $data);