From 5738be5c9881613bc5ec5b791efae0931e9bfdb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Thu, 28 May 2020 00:27:35 +0200 Subject: [PATCH] MAPG-43 move existing interfaces into separate namespace --- src/Controller/ControllerInterface.php | 8 -------- src/Controller/GameController.php | 7 ++++--- src/Controller/PositionController.php | 7 ++++--- src/Interfaces/Controller/IController.php | 8 ++++++++ src/Interfaces/View/IView.php | 10 ++++++++++ src/View/ViewBase.php | 4 +++- 6 files changed, 29 insertions(+), 15 deletions(-) delete mode 100644 src/Controller/ControllerInterface.php create mode 100644 src/Interfaces/Controller/IController.php create mode 100644 src/Interfaces/View/IView.php diff --git a/src/Controller/ControllerInterface.php b/src/Controller/ControllerInterface.php deleted file mode 100644 index 22d2f8f..0000000 --- a/src/Controller/ControllerInterface.php +++ /dev/null @@ -1,8 +0,0 @@ -jsonResponse = $jsonResponse; } - public function run(): ViewBase + public function run(): IView { $bounds = $this->getMapBounds(); diff --git a/src/Controller/PositionController.php b/src/Controller/PositionController.php index 24d4b13..9687a72 100644 --- a/src/Controller/PositionController.php +++ b/src/Controller/PositionController.php @@ -1,12 +1,13 @@ mysql = new mysqli($_ENV['DB_HOST'], $_ENV['DB_USER'], $_ENV['DB_PASSWORD'], $_ENV['DB_NAME']); } - public function run(): ViewBase + public function run(): IView { if (!isset($_SESSION['state']) || $_SESSION['state']['mapId'] !== $this->mapId) { $data = ['error' => 'No valid session found!']; diff --git a/src/Interfaces/Controller/IController.php b/src/Interfaces/Controller/IController.php new file mode 100644 index 0000000..07caeeb --- /dev/null +++ b/src/Interfaces/Controller/IController.php @@ -0,0 +1,8 @@ +