Skip to content

Mr-Ming/PHP-Shapes-Library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP-Shapes-Library

The PHP Shapes Library provides a library and an interface for shapes such as:

  1. Circle
  2. Right Triangle
  3. Equilateral Triangle
  4. Rectangle
  5. Square
  6. Parallelogram

A Demo of code: (by running php demo.php)

screen shot 2018-12-16 at 11 05 53 pm

Features

Each of these shapes provides:

  1. getArea() for calculating Area
  2. getPerimeter() for calculating Perimeter
  3. resize($percentage) for resizing
  4. Getters for getting base / height / radius / side (whichever one is applicable depending on shape)
  5. Setters for setting base / height / radius / side (whichever one is applicable depending on shape)

Additionally, there is a shapeInterface that governs the required method that needs to be implemented if new shape are added

Installation

  1. Clone this branch

Running Demo

  1. Clone this branch
  2. CD into root
  3. run php demo.php

About

PHP Shape Library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages