Code cleanup from inspection results

This commit is contained in:
Nabeel Shahzad
2018-08-26 13:50:08 -05:00
parent 0f3424f41e
commit e95b3eb366
76 changed files with 226 additions and 268 deletions

View File

@@ -15,7 +15,6 @@ use App\Models\Pirep;
use App\Repositories\AcarsRepository;
use App\Repositories\PirepRepository;
use App\Services\GeoService;
use App\Services\PirepService;
use Auth;
use Carbon\Carbon;
use Illuminate\Http\Request;
@@ -29,7 +28,6 @@ class AcarsController extends Controller
private $acarsRepo;
private $geoSvc;
private $pirepRepo;
private $pirepSvc;
/**
* AcarsController constructor.
@@ -37,18 +35,15 @@ class AcarsController extends Controller
* @param AcarsRepository $acarsRepo
* @param GeoService $geoSvc
* @param PirepRepository $pirepRepo
* @param PirepService $pirepSvc
*/
public function __construct(
AcarsRepository $acarsRepo,
GeoService $geoSvc,
PirepRepository $pirepRepo,
PirepService $pirepSvc
PirepRepository $pirepRepo
) {
$this->geoSvc = $geoSvc;
$this->acarsRepo = $acarsRepo;
$this->pirepRepo = $pirepRepo;
$this->pirepSvc = $pirepSvc;
}
/**

View File

@@ -222,6 +222,7 @@ class PirepController extends Controller
$pirep = new Pirep($attrs);
// See if this user is at the current airport
/** @noinspection NotOptimalIfConditionsInspection */
if (setting('pilots.only_flights_from_current')
&& $user->curr_airport_id !== $pirep->dpt_airport_id) {
throw new UserNotAtAirport();
@@ -234,6 +235,7 @@ class PirepController extends Controller
}
// See if this aircraft is at the departure airport
/** @noinspection NotOptimalIfConditionsInspection */
if (setting('pireps.only_aircraft_at_dpt_airport')
&& $pirep->aircraft_id !== $pirep->dpt_airport_id) {
throw new AircraftNotAtAirport();

View File

@@ -29,7 +29,6 @@ class UserController extends Controller
private $flightRepo;
private $flightSvc;
private $pirepRepo;
private $subfleetRepo;
private $userRepo;
private $userSvc;
@@ -39,7 +38,6 @@ class UserController extends Controller
* @param FlightRepository $flightRepo
* @param FlightService $flightSvc
* @param PirepRepository $pirepRepo
* @param SubfleetRepository $subfleetRepo
* @param UserRepository $userRepo
* @param UserService $userSvc
*/
@@ -47,14 +45,12 @@ class UserController extends Controller
FlightRepository $flightRepo,
FlightService $flightSvc,
PirepRepository $pirepRepo,
SubfleetRepository $subfleetRepo,
UserRepository $userRepo,
UserService $userSvc
) {
$this->flightRepo = $flightRepo;
$this->flightSvc = $flightSvc;
$this->pirepRepo = $pirepRepo;
$this->subfleetRepo = $subfleetRepo;
$this->userRepo = $userRepo;
$this->userSvc = $userSvc;
}