From 6aa3e21b4c9a393e857f09237bb3af01ffa5e77e Mon Sep 17 00:00:00 2001 From: Hereward Mills Date: Fri, 4 Dec 2015 08:09:01 +0000 Subject: [PATCH] TidyUp: Surpress errors on unreachable statements with link to discussion on github. --- app/controllers/admin/AssetsController.php | 1 + app/controllers/admin/LocationsController.php | 1 + app/controllers/admin/ModelsController.php | 2 +- app/controllers/admin/UsersController.php | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/AssetsController.php b/app/controllers/admin/AssetsController.php index ccf9295196..67f6808151 100755 --- a/app/controllers/admin/AssetsController.php +++ b/app/controllers/admin/AssetsController.php @@ -397,6 +397,7 @@ class AssetsController extends AdminController // Redirect to the asset management page with error + /** @noinspection PhpUnreachableStatementInspection Known to be unreachable but kept following discussion: https://github.com/snipe/snipe-it/pull/1423 */ return Redirect::to("hardware/$assetId/edit")->with('error', Lang::get('admin/hardware/message.update.error')); } diff --git a/app/controllers/admin/LocationsController.php b/app/controllers/admin/LocationsController.php index 06219e988a..47ad5aea71 100755 --- a/app/controllers/admin/LocationsController.php +++ b/app/controllers/admin/LocationsController.php @@ -143,6 +143,7 @@ class LocationsController extends AdminController } // Redirect to the location create page + /** @noinspection PhpUnreachableStatementInspection Known to be unreachable but kept following discussion: https://github.com/snipe/snipe-it/pull/1423 */ return Redirect::to('admin/settings/locations/create')->with('error', Lang::get('admin/locations/message.create.error')); } diff --git a/app/controllers/admin/ModelsController.php b/app/controllers/admin/ModelsController.php index ed4c3ed762..8efbff5a31 100755 --- a/app/controllers/admin/ModelsController.php +++ b/app/controllers/admin/ModelsController.php @@ -82,7 +82,7 @@ class ModelsController extends AdminController if ($validator->fails()) { // The given data did not pass validation - return Redirect::back()->withInput()->with('error', Lang::get('admin/models/message.create.duplicate_set'));; + return Redirect::back()->withInput()->with('error', Lang::get('admin/models/message.create.duplicate_set')); } diff --git a/app/controllers/admin/UsersController.php b/app/controllers/admin/UsersController.php index 460d216072..9759937de7 100755 --- a/app/controllers/admin/UsersController.php +++ b/app/controllers/admin/UsersController.php @@ -587,6 +587,7 @@ class UsersController extends AdminController { return Redirect::route('users')->with('error', 'Bulk delete is not enabled in this installation'); } + /** @noinspection PhpUnreachableStatementInspection Known to be unreachable but kept following discussion: https://github.com/snipe/snipe-it/pull/1423 */ return Redirect::route('users')->with('error', 'An error has occurred'); } }