Skip to content

Sunuba/PHPStrategyPattern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

First things first, please run composer install after cloning.

You do not need to change any class code. Just write your plain code.

Calculate Triangle:

echo 'Calculate Triangle: ' . (new Engineer())->calculateArea (10, 10, new Triangle());

Calculate Rectangle:

echo 'Calculate Rectangle: ' . (new Engineer())->calculateArea (10, 10, new Rectangle());

Calculate Circle:

echo 'Calculate Circle: ' . (new Engineer())->calculateArea (10, 0, new Circle());

About

In this repo, I tried to implement area calculation and applied strategy pattern

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages