diff options
Updated all double quotes to single quotes where possible
6 files changed, 22 insertions, 23 deletions
| -rw-r--r-- | src/controllers/BaseController.php | 17 | ||||
| -rw-r--r-- | src/controllers/CreateOfferController.php | 4 | ||||
| -rw-r--r-- | src/controllers/DashboardController.php | 8 | ||||
| -rw-r--r-- | src/controllers/DashboardLoginController.php | 8 | ||||
| -rw-r--r-- | src/controllers/EditOfferController.php | 2 | ||||
| -rw-r--r-- | src/controllers/LandingController.php | 6 |
diff --git a/src/controllers/BaseController.php b/src/controllers/BaseController.php index 2c2a647..f766398 100644 --- a/src/controllers/BaseController.php +++ b/src/controllers/BaseController.php @@ -1,14 +1,14 @@ <?php class BaseController { public static function invoke() { - switch ($_SERVER["REQUEST_METHOD"]) { - case "POST": + switch ($_SERVER['REQUEST_METHOD']) { + case 'POST': static::post(); break; - case "PUT": + case 'PUT': static::put(); break; - case "DELETE": + case 'DELETE': static::delete(); break; default: @@ -18,19 +18,18 @@ class BaseController { } protected static function get() { - echo "GET method not implemented!"; + echo 'GET method not implemented!'; } protected static function post() { - - echo "POST method not implemented!"; + echo 'POST method not implemented!'; } protected static function put() { - echo "PUT method not implemented!"; + echo 'PUT method not implemented!'; } protected static function delete() { - echo "DELETE method not implemented!"; + echo 'DELETE method not implemented!'; } } diff --git a/src/controllers/CreateOfferController.php b/src/controllers/CreateOfferController.php index a223463..bb6015b 100644 --- a/src/controllers/CreateOfferController.php +++ b/src/controllers/CreateOfferController.php @@ -7,7 +7,7 @@ class CreateOfferController extends BaseController { public static function get() { self::$companies = Company::getAllFromDB(); - include 'views/create-offer.php'; + include('views/create-offer.php'); } public static function post() { @@ -15,7 +15,7 @@ class CreateOfferController extends BaseController { JobOffer::insertIntoDB($newJobOffer); // Redirect to landing page - header("Location: /", TRUE, 301); + header('Location: /', TRUE, 301); exit(); } } diff --git a/src/controllers/DashboardController.php b/src/controllers/DashboardController.php index 548f60b..80717ca 100644 --- a/src/controllers/DashboardController.php +++ b/src/controllers/DashboardController.php @@ -12,18 +12,18 @@ class DashboardController extends BaseController { foreach(Company::getAllFromDB() as $company) { self::$companies[$company->id] = $company->name; } - include "views/dashboard.php"; + include('views/dashboard.php'); } public static function post() { switch($_POST['_method']) { - case "get": + case 'get': EditOfferController::get(); break; - case "put": + case 'put': EditOfferController::put(); break; - case "delete": + case 'delete': EditOfferController::delete(); break; } diff --git a/src/controllers/DashboardLoginController.php b/src/controllers/DashboardLoginController.php index fe2009b..af1113e 100644 --- a/src/controllers/DashboardLoginController.php +++ b/src/controllers/DashboardLoginController.php @@ -6,20 +6,20 @@ class DashboardLoginController extends BaseController { private static $message; public static function get() { - include "views/dashboard-login.php"; + include('views/dashboard-login.php'); } public static function post() { if (isset($_POST['_method'])) { DashboardController::invoke(); } - else if ($_POST['username'] == "admin" && $_POST['password'] == "admin") { + else if ($_POST['username'] == 'admin' && $_POST['password'] == 'admin') { // Load normal dashboard DashboardController::get(); } else { - self::$message = "Bad credentials!"; - include "views/dashboard-login.php"; + self::$message = 'Bad credentials!'; + include('views/dashboard-login.php'); } } } diff --git a/src/controllers/EditOfferController.php b/src/controllers/EditOfferController.php index ae49c5b..dc9a753 100644 --- a/src/controllers/EditOfferController.php +++ b/src/controllers/EditOfferController.php @@ -11,7 +11,7 @@ class EditOfferController extends BaseController { public static function get() { self::$job = JobOffer::getFromDBById($_POST['jobId']); self::$companies = Company::getAllFromDB(); - include "views/edit-offer.php"; + include('views/edit-offer.php'); } public static function put() { diff --git a/src/controllers/LandingController.php b/src/controllers/LandingController.php index ffa8644..9e81751 100644 --- a/src/controllers/LandingController.php +++ b/src/controllers/LandingController.php @@ -1,7 +1,7 @@ <?php -include_once("models/JobOffer.php"); +include_once('models/JobOffer.php'); include_once('models/Company.php'); -include_once("controllers/BaseController.php"); +include_once('controllers/BaseController.php'); class LandingController extends BaseController { private static $companies = array(); @@ -11,6 +11,6 @@ class LandingController extends BaseController { foreach(Company::getAllFromDB() as $company) { self::$companies[$company->id] = $company->name; } - include "views/landing.php"; + include('views/landing.php'); } } |
