Add php-cs-fixer to build
This commit is contained in:
@@ -36,11 +36,11 @@ class ImportCsv extends Command
|
||||
$type = $this->argument('type');
|
||||
$file = $this->argument('file');
|
||||
|
||||
if (\in_array($type, ['flight', 'flights'])) {
|
||||
if (\in_array($type, ['flight', 'flights'], true)) {
|
||||
$status = $this->importer->importFlights($file);
|
||||
} elseif ($type === 'aircraft') {
|
||||
$status = $this->importer->importAircraft($file);
|
||||
} elseif (\in_array($type, ['airport', 'airports'])) {
|
||||
} elseif (\in_array($type, ['airport', 'airports'], true)) {
|
||||
$status = $this->importer->importAirports($file);
|
||||
} elseif ($type === 'subfleet') {
|
||||
$status = $this->importer->importSubfleets($file);
|
||||
|
||||
@@ -18,7 +18,9 @@ class BidExists extends HttpException
|
||||
parent::__construct(
|
||||
409,
|
||||
'A bid already exists for this flight',
|
||||
$previous, $headers, $code
|
||||
$previous,
|
||||
$headers,
|
||||
$code
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,8 @@ class InternalError extends ValidationException
|
||||
$validator = Validator::make([], []);
|
||||
$validator->errors()->add(
|
||||
$field ?? static::FIELD,
|
||||
$message ?? static::MESSAGE);
|
||||
$message ?? static::MESSAGE
|
||||
);
|
||||
|
||||
parent::__construct($validator);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,9 @@ class PirepCancelled extends HttpException
|
||||
parent::__construct(
|
||||
400,
|
||||
'PIREP has been cancelled, updates are not allowed',
|
||||
$previous, $headers, $code
|
||||
$previous,
|
||||
$headers,
|
||||
$code
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,7 +232,9 @@ class AircraftController extends Controller
|
||||
if ($request->isMethod('post')) {
|
||||
ImportRequest::validate($request);
|
||||
$path = Storage::putFileAs(
|
||||
'import', $request->file('csv_file'), 'import_aircraft.csv'
|
||||
'import',
|
||||
$request->file('csv_file'),
|
||||
'import_aircraft.csv'
|
||||
);
|
||||
|
||||
$path = storage_path('app/'.$path);
|
||||
|
||||
@@ -229,7 +229,9 @@ class AirportController extends Controller
|
||||
if ($request->isMethod('post')) {
|
||||
ImportRequest::validate($request);
|
||||
$path = Storage::putFileAs(
|
||||
'import', $request->file('csv_file'), 'import_airports.csv'
|
||||
'import',
|
||||
$request->file('csv_file'),
|
||||
'import_airports.csv'
|
||||
);
|
||||
|
||||
$path = storage_path('app/'.$path);
|
||||
|
||||
@@ -229,7 +229,9 @@ class ExpenseController extends Controller
|
||||
if ($request->isMethod('post')) {
|
||||
ImportRequest::validate($request);
|
||||
$path = Storage::putFileAs(
|
||||
'import', $request->file('csv_file'), 'import_expenses.csv'
|
||||
'import',
|
||||
$request->file('csv_file'),
|
||||
'import_expenses.csv'
|
||||
);
|
||||
|
||||
$path = storage_path('app/'.$path);
|
||||
|
||||
@@ -204,7 +204,9 @@ class FareController extends Controller
|
||||
if ($request->isMethod('post')) {
|
||||
ImportRequest::validate($request);
|
||||
$path = Storage::putFileAs(
|
||||
'import', $request->file('csv_file'), 'import_fares.csv'
|
||||
'import',
|
||||
$request->file('csv_file'),
|
||||
'import_fares.csv'
|
||||
);
|
||||
|
||||
$path = storage_path('app/'.$path);
|
||||
|
||||
@@ -285,7 +285,8 @@ class FlightController extends Controller
|
||||
|
||||
$input['flight_time'] = Time::init(
|
||||
$input['minutes'],
|
||||
$input['hours'])->getMinutes();
|
||||
$input['hours']
|
||||
)->getMinutes();
|
||||
|
||||
$input['active'] = get_truth_state($input['active']);
|
||||
|
||||
@@ -355,7 +356,9 @@ class FlightController extends Controller
|
||||
|
||||
if ($request->isMethod('post')) {
|
||||
$path = Storage::putFileAs(
|
||||
'import', $request->file('csv_file'), 'import_flights.csv'
|
||||
'import',
|
||||
$request->file('csv_file'),
|
||||
'import_flights.csv'
|
||||
);
|
||||
|
||||
$path = storage_path('app/'.$path);
|
||||
|
||||
@@ -365,7 +365,8 @@ class PirepController extends Controller
|
||||
// Fix the time
|
||||
$attrs['flight_time'] = Time::init(
|
||||
$attrs['minutes'],
|
||||
$attrs['hours'])->getMinutes();
|
||||
$attrs['hours']
|
||||
)->getMinutes();
|
||||
|
||||
$pirep = $this->pirepRepo->update($attrs, $id);
|
||||
|
||||
|
||||
@@ -304,7 +304,9 @@ class SubfleetController extends Controller
|
||||
ImportRequest::validate($request);
|
||||
|
||||
$path = Storage::putFileAs(
|
||||
'import', $request->file('csv_file'), 'import_subfleets.csv'
|
||||
'import',
|
||||
$request->file('csv_file'),
|
||||
'import_subfleets.csv'
|
||||
);
|
||||
|
||||
$path = storage_path('app/'.$path);
|
||||
|
||||
@@ -23,7 +23,8 @@ class ResetPasswordController extends Controller
|
||||
*/
|
||||
public function showResetForm(Request $request, $token = null)
|
||||
{
|
||||
return view('auth.passwords.reset',
|
||||
return view(
|
||||
'auth.passwords.reset',
|
||||
['token' => $token, 'email' => $request->email]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -406,7 +406,8 @@ class PirepController extends Controller
|
||||
// Fix the time
|
||||
$attrs['flight_time'] = Time::init(
|
||||
$attrs['minutes'],
|
||||
$attrs['hours'])->getMinutes();
|
||||
$attrs['hours']
|
||||
)->getMinutes();
|
||||
|
||||
$pirep = $this->pirepRepo->update($attrs, $id);
|
||||
|
||||
|
||||
@@ -108,8 +108,10 @@ class NotificationEvents extends Listener
|
||||
|
||||
if ($event->old_state === UserState::PENDING) {
|
||||
if ($event->user->state === UserState::ACTIVE) {
|
||||
$email = new \App\Mail\UserRegistered($event->user,
|
||||
'Your registration has been accepted!');
|
||||
$email = new \App\Mail\UserRegistered(
|
||||
$event->user,
|
||||
'Your registration has been accepted!'
|
||||
);
|
||||
} elseif ($event->user->state === UserState::REJECTED) {
|
||||
$email = new \App\Mail\UserRejected($event->user);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,8 @@ class Acars extends Model
|
||||
{
|
||||
if ($value instanceof Distance) {
|
||||
$this->attributes['distance'] = $value->toUnit(
|
||||
config('phpvms.internal_units.distance'));
|
||||
config('phpvms.internal_units.distance')
|
||||
);
|
||||
} else {
|
||||
$this->attributes['distance'] = $value;
|
||||
}
|
||||
|
||||
@@ -76,15 +76,19 @@ Route::group([
|
||||
Route::resource('subfleets', 'SubfleetController');
|
||||
|
||||
Route::resource('users', 'UserController');
|
||||
Route::get('users/{id}/regen_apikey',
|
||||
'UserController@regen_apikey')->name('users.regen_apikey');
|
||||
Route::get(
|
||||
'users/{id}/regen_apikey',
|
||||
'UserController@regen_apikey'
|
||||
)->name('users.regen_apikey');
|
||||
|
||||
// defaults
|
||||
Route::get('', ['uses' => 'DashboardController@index']);
|
||||
Route::get('/', ['uses' => 'DashboardController@index']);
|
||||
|
||||
Route::get('dashboard', ['uses' => 'DashboardController@index', 'name' => 'dashboard']);
|
||||
Route::match(['get', 'post', 'delete'],
|
||||
'dashboard/news', ['uses' => 'DashboardController@news'])
|
||||
->name('dashboard.news');
|
||||
Route::match(
|
||||
['get', 'post', 'delete'],
|
||||
'dashboard/news',
|
||||
['uses' => 'DashboardController@news']
|
||||
)->name('dashboard.news');
|
||||
});
|
||||
|
||||
@@ -625,7 +625,6 @@ class Metar implements \ArrayAccess
|
||||
$minute = (int) $found[3];
|
||||
|
||||
if ($this->result['observed_date'] === null) {
|
||||
|
||||
// Take one month, if the observed day is greater than the current day
|
||||
if ($day > date('j')) {
|
||||
$month = date('n') - 1;
|
||||
|
||||
Reference in New Issue
Block a user