-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
23 lines (14 loc) · 873 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
require_once('./vendor/autoload.php');
$rectangle = new \MniShihan\LearnOOP\Concretes\Shapes\Rectangle(2, 4);
$circle = new \MniShihan\LearnOOP\Concretes\Shapes\Circle(2);
$square = new \MniShihan\LearnOOP\Concretes\Shapes\Square(5);
$triangle = new \MniShihan\LearnOOP\Concretes\Shapes\Triangle(4, 2.5);
$cow = new \MniShihan\LearnOOP\Concretes\Animals\Cow(2);
$cat = new \MniShihan\LearnOOP\Concretes\Animals\Cat(1.2);
$dog = new \MniShihan\LearnOOP\Concretes\Animals\Dog(3);
$areaAggregator1 = new MniShihan\LearnOOP\AreaAggregator($rectangle, $circle);
$areaAggregator2 = new MniShihan\LearnOOP\AreaAggregator($areaAggregator1, $square, $triangle);
echo "Sum of all areas = " . $areaAggregator2->calculateArea() . PHP_EOL;
$describer = new \MniShihan\LearnOOP\Describer();
$describer->describe($rectangle, $circle, $square, $triangle, $cow, $cat, $dog);