From 2dcbe38baf4236278b6a8d0399e0f25d3737495f Mon Sep 17 00:00:00 2001 From: Alejandro Avila Date: Mon, 20 Jun 2022 15:24:29 +0100 Subject: [PATCH 1/2] feat: :sparkles: solution first part of the pill --- solutions/human.php | 26 ++++++++++++++++++++++ solutions/livingBeing.php | 38 ++++++++++++++++++++++++++++++++ solutions/mammal.php | 46 +++++++++++++++++++++++++++++++++++++++ solutions/run.php | 12 ++++++++++ 4 files changed, 122 insertions(+) create mode 100644 solutions/human.php create mode 100644 solutions/livingBeing.php create mode 100644 solutions/mammal.php create mode 100644 solutions/run.php diff --git a/solutions/human.php b/solutions/human.php new file mode 100644 index 0000000..3644b43 --- /dev/null +++ b/solutions/human.php @@ -0,0 +1,26 @@ +salary = $salary; + } + + public function getCarrer() + { + return $this->carrer; + } + + public function getNumberOfChilds() + { + $childs = parent::getNumberOfChilds(); + return 'number of childs ' . $childs; + } +} diff --git a/solutions/livingBeing.php b/solutions/livingBeing.php new file mode 100644 index 0000000..7ed53d5 --- /dev/null +++ b/solutions/livingBeing.php @@ -0,0 +1,38 @@ + +planet = $planet; + $this->enviroment = $enviroment; + } + + public function getEnviroment() + { + return $this->enviroment; + } + + public function getPlanet() + { + return $this->planet; + } + + public function __destruct() + { + echo "destruct living being"; + } +} diff --git a/solutions/mammal.php b/solutions/mammal.php new file mode 100644 index 0000000..d17f802 --- /dev/null +++ b/solutions/mammal.php @@ -0,0 +1,46 @@ +name = $name; + $this->age = $age; + $this->sound = $sound; + $this->numberOfChilds = $numberOfChilds; + } + + public function getName() + { + return $this->name; + } + + public function getAge() + { + return $this->age; + } + + public function getSound() + { + return $this->sound; + } + + public function getNumberOfChilds() + { + return $this->numberOfChilds; + } + + + public function __destruct() + { + } +}; diff --git a/solutions/run.php b/solutions/run.php new file mode 100644 index 0000000..54a555c --- /dev/null +++ b/solutions/run.php @@ -0,0 +1,12 @@ + Date: Mon, 20 Jun 2022 15:25:30 +0100 Subject: [PATCH 2/2] feat: :sparkles: added solution to second part of the pill --- solutionPill/animal.php | 49 +++++++++++++++++++++++++++++++++++++++++ solutionPill/cat.php | 34 ++++++++++++++++++++++++++++ solutionPill/run.php | 10 +++++++++ 3 files changed, 93 insertions(+) create mode 100644 solutionPill/animal.php create mode 100644 solutionPill/cat.php create mode 100644 solutionPill/run.php diff --git a/solutionPill/animal.php b/solutionPill/animal.php new file mode 100644 index 0000000..d8b4af6 --- /dev/null +++ b/solutionPill/animal.php @@ -0,0 +1,49 @@ +age = $age; + $this->fur = $fur; + $this->vertebrates = $vertebrates; + $this->type = $type; + } + + public function breath() + { + echo 'i can breath'; + } + + public function move() + { + echo 'i can move'; + } + + public function sound() + { + echo 'i can make a sound'; + } + + public function getAge() + { + return $this->age; + } + + + + public function __destruct() + { + } +} diff --git a/solutionPill/cat.php b/solutionPill/cat.php new file mode 100644 index 0000000..57536a9 --- /dev/null +++ b/solutionPill/cat.php @@ -0,0 +1,34 @@ +breed = $breed; + $this->age = $age * 7; + } + + public function purr() + { + echo 'i can purr'; + } + + public function sound() + { + echo ' i can meow'; + } +} + +abstract class Feline +{ + private $whiskerType; + + public function throwObjectInstance() + { + return get_object_vars($this); + } +} diff --git a/solutionPill/run.php b/solutionPill/run.php new file mode 100644 index 0000000..ebaba98 --- /dev/null +++ b/solutionPill/run.php @@ -0,0 +1,10 @@ +