-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathindex.php
More file actions
25 lines (16 loc) · 542 Bytes
/
Copy pathindex.php
File metadata and controls
25 lines (16 loc) · 542 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
use App\ShapeFactory;
require 'vendor/autoload.php';
$shapeFactory = new ShapeFactory();
//get an object of Circle and call its draw method.
$shape1 = $shapeFactory->getShape("CIRCLE");
//call draw method of Circle
$shape1->draw();
//get an object of Rectangle and call its draw method.
$shape2 = $shapeFactory->getShape("RECTANGLE");
//call draw method of Rectangle
$shape2->draw();
//get an object of Square and call its draw method.
$shape3 = $shapeFactory->getShape("SQUARE");
//call draw method of square
$shape3->draw();