-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdi.php
More file actions
23 lines (19 loc) · 1.07 KB
/
Copy pathdi.php
File metadata and controls
23 lines (19 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
use Main\Zandstra\Chapter9\DependencyInjection\AppointmentMaker;
use Main\Zandstra\Chapter9\DependencyInjection\AppointmentMaker2;
use Main\Zandstra\Chapter9\DependencyInjection\ObjectAssembler;
use Main\Zandstra\Chapter9\FactoryMethod\ApptEncoder;
use Main\Zandstra\Chapter9\FactoryMethod\MegaApptEncoder;
use Main\Zandstra\Chapter9\Prototype\TerrainFactory;
require __DIR__ .'/vendor/autoload.php';
// $assembler = new ObjectAssembler("src/Zandstra/Chapter9/DependencyInjection/conf.xml");
// $encoder = $assembler->getComponent(ApptEncoder::class);
// $apptmaker = $assembler->getComponent(AppointmentMaker2::class);
// $encoder = $assembler->getComponent(MegaApptEncoder::class); //тоже сработает, если не будет в xml файле прописан
// $apptmaker = new AppointmentMaker2($encoder);
// $out = $apptmaker->makeAppoinment();
// print $out;
$assembler = new ObjectAssembler("src/Zandstra/Chapter9/DependencyInjection/conf2.xml");
$apptmaker = $assembler->getComponent(AppointmentMaker::class);
$output = $apptmaker->makeAppointment();
print $output;