commit fea8580204adbf5f7a7d45b5ca54607e949ab65d Author: Kavalar Date: Fri May 17 14:16:29 2024 +0300 first diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..723ef36 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..0e70474 --- /dev/null +++ b/index.php @@ -0,0 +1,24 @@ +makeSound(); +$cat->makeSound(); +$cow->makeSound(); + +$dog->makeJump(); +$cat->makeJump(); + +echo "
";
+print_r($cat);
+
+$cat->meow();
+$dog->woof();
\ No newline at end of file
diff --git a/src/Animal.php b/src/Animal.php
new file mode 100644
index 0000000..972ae5a
--- /dev/null
+++ b/src/Animal.php
@@ -0,0 +1,30 @@
+paws++;
+    }
+
+    abstract public function makeSound(): void;
+
+    /**
+     * @return void
+     */
+    public function beating(): void
+    {
+        $this->heart++;
+    }
+
+}
\ No newline at end of file
diff --git a/src/Cat.php b/src/Cat.php
new file mode 100644
index 0000000..6a9cceb
--- /dev/null
+++ b/src/Cat.php
@@ -0,0 +1,27 @@
+type . " - shipe shipe shipe shipe shipe shipe shipe shipe shipe shipe shipe  
"; + } + + public function meow() + { + echo $this->type . " - meow meow meow meow meow meow meow meow meow meow meow meow meow meow
"; + } + +} \ No newline at end of file diff --git a/src/Cow.php b/src/Cow.php new file mode 100644 index 0000000..5192112 --- /dev/null +++ b/src/Cow.php @@ -0,0 +1,13 @@ +type . " - mu mu mu mu mu mu mu mu mu mu mu mu mu mu mu mu mu
"; + } +} \ No newline at end of file diff --git a/src/Dog.php b/src/Dog.php new file mode 100644 index 0000000..e043371 --- /dev/null +++ b/src/Dog.php @@ -0,0 +1,23 @@ +type . " - growling growling growling growling growling growling growling growling
"; + } + + public function woof() + { + echo $this->type . " - woof woof woof woof woof woof woof woof woof woof woof woof woof woof
"; + } + +} \ No newline at end of file diff --git a/src/interfaces/TypeInterface.php b/src/interfaces/TypeInterface.php new file mode 100644 index 0000000..8d0b677 --- /dev/null +++ b/src/interfaces/TypeInterface.php @@ -0,0 +1,9 @@ +type . " - jump jump jump jump jump jump jump jump jump jump
"; + } + +} \ No newline at end of file