Fix formatting and interfaces in nearly every file

This commit is contained in:
Nabeel Shahzad
2018-03-19 20:50:40 -05:00
parent 04c5b9e7bf
commit ccf56ddec1
331 changed files with 3282 additions and 2492 deletions

View File

@@ -3,10 +3,10 @@
namespace App\Services;
use App\Exceptions\BidExists;
use App\Models\Flight;
use App\Models\Subfleet;
use App\Models\User;
use App\Interfaces\Service;
use App\Models\Bid;
use App\Models\Flight;
use App\Models\User;
use App\Repositories\FlightRepository;
use App\Repositories\NavdataRepository;
use Log;
@@ -15,20 +15,26 @@ use Log;
* Class FlightService
* @package App\Services
*/
class FlightService extends BaseService
class FlightService extends Service
{
private $fareSvc,
$flightRepo,
$navDataRepo,
$userSvc;
$flightRepo,
$navDataRepo,
$userSvc;
/**
* FlightService constructor.
* @param FareService $fareSvc
* @param FlightRepository $flightRepo
* @param NavdataRepository $navdataRepo
* @param UserService $userSvc
*/
public function __construct(
FareService $fareSvc,
FlightRepository $flightRepo,
NavdataRepository $navdataRepo,
UserService $userSvc
)
{
) {
$this->fareSvc = $fareSvc;
$this->flightRepo = $flightRepo;
$this->navDataRepo = $navdataRepo;
@@ -59,7 +65,6 @@ class FlightService extends BaseService
*/
public function filterSubfleets($user, $flight)
{
$subfleets = $flight->subfleets;
/**
@@ -135,7 +140,7 @@ class FlightService extends BaseService
/**
* Allow a user to bid on a flight. Check settings and all that good stuff
* @param Flight $flight
* @param User $user
* @param User $user
* @return Bid|null
* @throws \App\Exceptions\BidExists
*/
@@ -143,7 +148,7 @@ class FlightService extends BaseService
{
# If it's already been bid on, then it can't be bid on again
if ($flight->has_bid && setting('bids.disable_flight_on_bid')) {
Log::info($flight->id . ' already has a bid, skipping');
Log::info($flight->id.' already has a bid, skipping');
throw new BidExists();
}
@@ -151,14 +156,14 @@ class FlightService extends BaseService
if (!setting('bids.allow_multiple_bids')) {
$user_bids = Bid::where(['user_id' => $user->id])->first();
if ($user_bids) {
Log::info('User "' . $user->id . '" already has bids, skipping');
Log::info('User "'.$user->id.'" already has bids, skipping');
throw new BidExists();
}
}
# See if this user has this flight bid on already
$bid_data = [
'user_id' => $user->id,
'user_id' => $user->id,
'flight_id' => $flight->id
];
@@ -178,7 +183,7 @@ class FlightService extends BaseService
/**
* Remove a bid from a given flight
* @param Flight $flight
* @param User $user
* @param User $user
*/
public function removeBid(Flight $flight, User $user)
{