From e0dc21312f6c4b4ed1c57b69e4dd879548f66dfc Mon Sep 17 00:00:00 2001 From: MohamadAli011 Date: Wed, 12 Apr 2023 11:55:10 +0700 Subject: [PATCH] first commit --- .gitignore | 1 + App.php | 14 ++++++++++++++ BusinessLogic/AddTodoList.php | 13 +++++++++++++ BusinessLogic/RemoveTodoList.php | 21 ++++++++++++++++++++ BusinessLogic/ShowTodoList.php | 15 +++++++++++++++ Helper/Input.php | 8 ++++++++ Model/TodoList.php | 3 +++ Test/TestAddTodoList.php | 11 +++++++++++ Test/TestInput.php | 9 +++++++++ Test/TestRemoveTodoList.php | 28 +++++++++++++++++++++++++++ Test/TestShowTodoList.php | 10 ++++++++++ Test/TestViewAddTodoList.php | 17 ++++++++++++++++ Test/TestViewRemoveTodoList.php | 19 ++++++++++++++++++ Test/TestViewShowTodoList.php | 13 +++++++++++++ View/ViewAddTodoList.php | 18 +++++++++++++++++ View/ViewRemoveTodoList.php | 23 ++++++++++++++++++++++ View/ViewShowTodoList.php | 33 ++++++++++++++++++++++++++++++++ 17 files changed, 256 insertions(+) create mode 100644 .gitignore create mode 100644 App.php create mode 100644 BusinessLogic/AddTodoList.php create mode 100644 BusinessLogic/RemoveTodoList.php create mode 100644 BusinessLogic/ShowTodoList.php create mode 100644 Helper/Input.php create mode 100644 Model/TodoList.php create mode 100644 Test/TestAddTodoList.php create mode 100644 Test/TestInput.php create mode 100644 Test/TestRemoveTodoList.php create mode 100644 Test/TestShowTodoList.php create mode 100644 Test/TestViewAddTodoList.php create mode 100644 Test/TestViewRemoveTodoList.php create mode 100644 Test/TestViewShowTodoList.php create mode 100644 View/ViewAddTodoList.php create mode 100644 View/ViewRemoveTodoList.php create mode 100644 View/ViewShowTodoList.php 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/App.php b/App.php new file mode 100644 index 0000000..5d8f562 --- /dev/null +++ b/App.php @@ -0,0 +1,14 @@ + sizeof($todoList)) { + return false; + } + + for ($i = $number; $i < sizeof($todoList); $i++) { + $todoList[$i] = $todoList[$i + 1]; + } + + unset($todoList[sizeof($todoList)]); + + return true; +} diff --git a/BusinessLogic/ShowTodoList.php b/BusinessLogic/ShowTodoList.php new file mode 100644 index 0000000..e7385ba --- /dev/null +++ b/BusinessLogic/ShowTodoList.php @@ -0,0 +1,15 @@ + $value) { + echo "$number. $value" . PHP_EOL; + } +} diff --git a/Helper/Input.php b/Helper/Input.php new file mode 100644 index 0000000..4a9e401 --- /dev/null +++ b/Helper/Input.php @@ -0,0 +1,8 @@ +