Skip to content

Commit c069e46

Browse files
committed
create default application file for static factory
1 parent 0f8868c commit c069e46

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

app/Controller/CreationalController.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@ public function acmePrototype()
8383

8484
public function staticFactory()
8585
{
86-
$supplier = \App\Patterns\Creational\StaticFactory\Suppliers\FlightSupplierFactory::get(1);
87-
echo $supplier->request('My booking was cancelled without prior notification') . "<br/><br/>";
88-
89-
$supplier = \App\Patterns\Creational\StaticFactory\Suppliers\FlightSupplierFactory::get(2);
90-
echo $supplier->request('Please book a ticket for me');
86+
(new \App\Patterns\Creational\StaticFactory\Suppliers\Application)->render();
9187
}
9288
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php namespace App\Patterns\Creational\StaticFactory\Suppliers;
2+
3+
class Application
4+
{
5+
public function render()
6+
{
7+
$supplier = FlightSupplierFactory::get(1);
8+
echo $supplier->request('My booking was cancelled without prior notification') . "<br/><br/>";
9+
10+
$supplier = FlightSupplierFactory::get(2);
11+
echo $supplier->request('Please book a ticket for me');
12+
}
13+
}

0 commit comments

Comments
 (0)