diff --git a/src/Circle.php b/src/Circle.php new file mode 100644 index 0000000..5dbfbe2 --- /dev/null +++ b/src/Circle.php @@ -0,0 +1,26 @@ +radius = $circle_radius; + } + + function area (){ + $circle_area = pi() * $this->radius * $this->radius; + return $circle_area; + } + + public function getFullDescription (){ + $string = ""; + $string .= get_class($this)."<#"; + $string .= $this->getId(). ">: "; + $string .= $this->getName(). " - "; + $string .= $this->radius; + + return $string; + } +} +?> \ No newline at end of file diff --git a/src/Rectangle.php b/src/Rectangle.php new file mode 100644 index 0000000..a0e022e --- /dev/null +++ b/src/Rectangle.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/src/Shape.php b/src/Shape.php new file mode 100644 index 0000000..2160d4f --- /dev/null +++ b/src/Shape.php @@ -0,0 +1,48 @@ +length = $shape_length; + $this->width = $shape_width; + $this->id = uniqid(); + } + + function getName (){ + return $this->name; + } + + function setName($new_name){ + $this->name = $new_name; + } + + function getId() { + return $this->id; + } + function area (){ + $shape_area = $this->length * $this->width; + return $shape_area; + } + + static function getTypeDescription (){ + return ("Type: ".static::SHAPE_TYPE); + } + + public function getFullDescription (){ + $string = ""; + $string .= get_class($this)."<#"; + $string .= $this->getId(). ">: "; + $string .= $this->getName(). " - "; + $string .= $this->length. " x "; + $string .= $this->width; + + return $string; + } +} + + +?> \ No newline at end of file