@@ -1,4 +1,5 @@
|
|||||||
_ide_helper.php
|
_ide_helper.php
|
||||||
|
.php_cs.cache
|
||||||
.phpstorm.meta.php
|
.phpstorm.meta.php
|
||||||
/vendor
|
/vendor
|
||||||
node_modules/
|
node_modules/
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$finder = PhpCsFixer\Finder::create()
|
||||||
|
->in('app')
|
||||||
|
->in('config');
|
||||||
|
|
||||||
|
return PhpCsFixer\Config::create()
|
||||||
|
->setHideProgress(true)
|
||||||
|
->setUsingCache(false)
|
||||||
|
->setRiskyAllowed(true)
|
||||||
|
->setRules([
|
||||||
|
'@PSR2' => true,
|
||||||
|
'strict_param' => true,
|
||||||
|
'no_php4_constructor' => true,
|
||||||
|
'no_extra_blank_lines' => true,
|
||||||
|
'no_superfluous_elseif' => true,
|
||||||
|
'single_line_comment_style' => false,
|
||||||
|
'simple_to_complex_string_variable' => true,
|
||||||
|
'array_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'binary_operator_spaces' => [
|
||||||
|
'align_double_arrow' => true,
|
||||||
|
],
|
||||||
|
/*
|
||||||
|
'blank_line_before_statement' => [
|
||||||
|
'statements' => [
|
||||||
|
'declare',
|
||||||
|
'for',
|
||||||
|
'return',
|
||||||
|
'throw',
|
||||||
|
'try',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
*/
|
||||||
|
])
|
||||||
|
->setFinder($finder);
|
||||||
@@ -31,6 +31,7 @@ install:
|
|||||||
- composer install --dev --no-interaction --verbose
|
- composer install --dev --no-interaction --verbose
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
- vendor/bin/php-cs-fixer fix --config=.php_cs -v --dry-run --diff --using-cache=no
|
||||||
- php artisan database:create --reset
|
- php artisan database:create --reset
|
||||||
- php artisan migrate:refresh --seed
|
- php artisan migrate:refresh --seed
|
||||||
- cp .travis/phpunit.travis.xml phpunit.xml
|
- cp .travis/phpunit.travis.xml phpunit.xml
|
||||||
|
|||||||
@@ -61,12 +61,15 @@ if [ "$TRAVIS" = "true" ]; then
|
|||||||
.dpl
|
.dpl
|
||||||
.eslintignore
|
.eslintignore
|
||||||
.eslintrc
|
.eslintrc
|
||||||
|
.php_cs
|
||||||
|
.php_cs.cache
|
||||||
.phpstorm.meta.php
|
.phpstorm.meta.php
|
||||||
.styleci.yml
|
.styleci.yml
|
||||||
env.php
|
env.php
|
||||||
config.php
|
config.php
|
||||||
docker-compose.yml
|
docker-compose.yml
|
||||||
Makefile
|
Makefile
|
||||||
|
phpcs.xml
|
||||||
phpunit.xml
|
phpunit.xml
|
||||||
phpvms.iml
|
phpvms.iml
|
||||||
Procfile
|
Procfile
|
||||||
|
|||||||
@@ -22,6 +22,14 @@
|
|||||||
<listener class="NunoMaduro\Collision\Adapters\Phpunit\Listener"/>
|
<listener class="NunoMaduro\Collision\Adapters\Phpunit\Listener"/>
|
||||||
</listeners>
|
</listeners>
|
||||||
<php>
|
<php>
|
||||||
|
<env name="APP_ENV" value="test"/>
|
||||||
|
<env name="APP_KEY" value="base64:ve66Z5Kt/zTN3p++0zOPu854PHfZkwJE5VuoFAlzHtI="/>
|
||||||
|
<env name="APP_DEBUG" value="true"/>
|
||||||
|
<env name="APP_LOG_LEVEL" value="debug"/>
|
||||||
|
<env name="DB_CONNECTION" value="memory"/>
|
||||||
|
<env name="CACHE_DRIVER" value="array"/>
|
||||||
|
<env name="SESSION_DRIVER" value="array"/>
|
||||||
|
<env name="QUEUE_DRIVER" value="sync"/>
|
||||||
<ini name="error_reporting" value="E_ALL"/>
|
<ini name="error_reporting" value="E_ALL"/>
|
||||||
<ini name="display_errors" value="On"/>
|
<ini name="display_errors" value="On"/>
|
||||||
<ini name="display_startup_errors" value="On"/>
|
<ini name="display_startup_errors" value="On"/>
|
||||||
|
|||||||
@@ -68,6 +68,10 @@ test:
|
|||||||
#php artisan database:create --reset
|
#php artisan database:create --reset
|
||||||
vendor/bin/phpunit --debug --verbose
|
vendor/bin/phpunit --debug --verbose
|
||||||
|
|
||||||
|
.PHONY: phpcs
|
||||||
|
phpcs:
|
||||||
|
@vendor/bin/php-cs-fixer fix --config=.php_cs -v --diff --dry-run
|
||||||
|
|
||||||
.PHONY:
|
.PHONY:
|
||||||
phpstan:
|
phpstan:
|
||||||
vendor/bin/phpstan analyse -c phpstan.neon -v --level 2 app
|
vendor/bin/phpstan analyse -c phpstan.neon -v --level 2 app
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ A full development environment can be brought up using Docker:
|
|||||||
```bash
|
```bash
|
||||||
composer install
|
composer install
|
||||||
npm install
|
npm install
|
||||||
|
docker-compose build
|
||||||
docker-compose up
|
docker-compose up
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -36,11 +36,11 @@ class ImportCsv extends Command
|
|||||||
$type = $this->argument('type');
|
$type = $this->argument('type');
|
||||||
$file = $this->argument('file');
|
$file = $this->argument('file');
|
||||||
|
|
||||||
if (\in_array($type, ['flight', 'flights'])) {
|
if (\in_array($type, ['flight', 'flights'], true)) {
|
||||||
$status = $this->importer->importFlights($file);
|
$status = $this->importer->importFlights($file);
|
||||||
} elseif ($type === 'aircraft') {
|
} elseif ($type === 'aircraft') {
|
||||||
$status = $this->importer->importAircraft($file);
|
$status = $this->importer->importAircraft($file);
|
||||||
} elseif (\in_array($type, ['airport', 'airports'])) {
|
} elseif (\in_array($type, ['airport', 'airports'], true)) {
|
||||||
$status = $this->importer->importAirports($file);
|
$status = $this->importer->importAirports($file);
|
||||||
} elseif ($type === 'subfleet') {
|
} elseif ($type === 'subfleet') {
|
||||||
$status = $this->importer->importSubfleets($file);
|
$status = $this->importer->importSubfleets($file);
|
||||||
|
|||||||
@@ -419,7 +419,8 @@ class Importer
|
|||||||
['icao' => $row->icao,
|
['icao' => $row->icao,
|
||||||
'subfleet_id' => $subfleet->id,
|
'subfleet_id' => $subfleet->id,
|
||||||
'active' => $row->enabled,
|
'active' => $row->enabled,
|
||||||
]);
|
]
|
||||||
|
);
|
||||||
|
|
||||||
$this->addMapping('aircraft', $row->id, $aircraft->id);
|
$this->addMapping('aircraft', $row->id, $aircraft->id);
|
||||||
|
|
||||||
@@ -682,14 +683,22 @@ class Importer
|
|||||||
// Decide which state they will be in accordance with v7
|
// Decide which state they will be in accordance with v7
|
||||||
if ($state === $phpvms_classic_states['ACTIVE']) {
|
if ($state === $phpvms_classic_states['ACTIVE']) {
|
||||||
return UserState::ACTIVE;
|
return UserState::ACTIVE;
|
||||||
} elseif ($state === $phpvms_classic_states['INACTIVE']) {
|
}
|
||||||
|
|
||||||
|
if ($state === $phpvms_classic_states['INACTIVE']) {
|
||||||
// TODO: Make an inactive state?
|
// TODO: Make an inactive state?
|
||||||
return UserState::REJECTED;
|
return UserState::REJECTED;
|
||||||
} elseif ($state === $phpvms_classic_states['BANNED']) {
|
}
|
||||||
|
|
||||||
|
if ($state === $phpvms_classic_states['BANNED']) {
|
||||||
return UserState::SUSPENDED;
|
return UserState::SUSPENDED;
|
||||||
} elseif ($state === $phpvms_classic_states['ON_LEAVE']) {
|
}
|
||||||
|
|
||||||
|
if ($state === $phpvms_classic_states['ON_LEAVE']) {
|
||||||
return UserState::ON_LEAVE;
|
return UserState::ON_LEAVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->error('Unknown status: '.$state);
|
$this->error('Unknown status: '.$state);
|
||||||
|
return UserState::ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ class BidExists extends HttpException
|
|||||||
parent::__construct(
|
parent::__construct(
|
||||||
409,
|
409,
|
||||||
'A bid already exists for this flight',
|
'A bid already exists for this flight',
|
||||||
$previous, $headers, $code
|
$previous,
|
||||||
|
$headers,
|
||||||
|
$code
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
|||||||
use Illuminate\Validation\ValidationException;
|
use Illuminate\Validation\ValidationException;
|
||||||
use Log;
|
use Log;
|
||||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||||
|
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
|
||||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -134,7 +135,7 @@ class Handler extends ExceptionHandler
|
|||||||
*
|
*
|
||||||
* @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response
|
* @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response
|
||||||
*/
|
*/
|
||||||
protected function renderHttpException(HttpException $e)
|
protected function renderHttpException(HttpExceptionInterface $e)
|
||||||
{
|
{
|
||||||
$status = $e->getStatusCode();
|
$status = $e->getStatusCode();
|
||||||
view()->replaceNamespace('errors', [
|
view()->replaceNamespace('errors', [
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ class InternalError extends ValidationException
|
|||||||
$validator = Validator::make([], []);
|
$validator = Validator::make([], []);
|
||||||
$validator->errors()->add(
|
$validator->errors()->add(
|
||||||
$field ?? static::FIELD,
|
$field ?? static::FIELD,
|
||||||
$message ?? static::MESSAGE);
|
$message ?? static::MESSAGE
|
||||||
|
);
|
||||||
|
|
||||||
parent::__construct($validator);
|
parent::__construct($validator);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ class PirepCancelled extends HttpException
|
|||||||
parent::__construct(
|
parent::__construct(
|
||||||
400,
|
400,
|
||||||
'PIREP has been cancelled, updates are not allowed',
|
'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')) {
|
if ($request->isMethod('post')) {
|
||||||
ImportRequest::validate($request);
|
ImportRequest::validate($request);
|
||||||
$path = Storage::putFileAs(
|
$path = Storage::putFileAs(
|
||||||
'import', $request->file('csv_file'), 'import_aircraft.csv'
|
'import',
|
||||||
|
$request->file('csv_file'),
|
||||||
|
'import_aircraft.csv'
|
||||||
);
|
);
|
||||||
|
|
||||||
$path = storage_path('app/'.$path);
|
$path = storage_path('app/'.$path);
|
||||||
|
|||||||
@@ -229,7 +229,9 @@ class AirportController extends Controller
|
|||||||
if ($request->isMethod('post')) {
|
if ($request->isMethod('post')) {
|
||||||
ImportRequest::validate($request);
|
ImportRequest::validate($request);
|
||||||
$path = Storage::putFileAs(
|
$path = Storage::putFileAs(
|
||||||
'import', $request->file('csv_file'), 'import_airports.csv'
|
'import',
|
||||||
|
$request->file('csv_file'),
|
||||||
|
'import_airports.csv'
|
||||||
);
|
);
|
||||||
|
|
||||||
$path = storage_path('app/'.$path);
|
$path = storage_path('app/'.$path);
|
||||||
|
|||||||
@@ -229,7 +229,9 @@ class ExpenseController extends Controller
|
|||||||
if ($request->isMethod('post')) {
|
if ($request->isMethod('post')) {
|
||||||
ImportRequest::validate($request);
|
ImportRequest::validate($request);
|
||||||
$path = Storage::putFileAs(
|
$path = Storage::putFileAs(
|
||||||
'import', $request->file('csv_file'), 'import_expenses.csv'
|
'import',
|
||||||
|
$request->file('csv_file'),
|
||||||
|
'import_expenses.csv'
|
||||||
);
|
);
|
||||||
|
|
||||||
$path = storage_path('app/'.$path);
|
$path = storage_path('app/'.$path);
|
||||||
|
|||||||
@@ -204,7 +204,9 @@ class FareController extends Controller
|
|||||||
if ($request->isMethod('post')) {
|
if ($request->isMethod('post')) {
|
||||||
ImportRequest::validate($request);
|
ImportRequest::validate($request);
|
||||||
$path = Storage::putFileAs(
|
$path = Storage::putFileAs(
|
||||||
'import', $request->file('csv_file'), 'import_fares.csv'
|
'import',
|
||||||
|
$request->file('csv_file'),
|
||||||
|
'import_fares.csv'
|
||||||
);
|
);
|
||||||
|
|
||||||
$path = storage_path('app/'.$path);
|
$path = storage_path('app/'.$path);
|
||||||
|
|||||||
@@ -285,7 +285,8 @@ class FlightController extends Controller
|
|||||||
|
|
||||||
$input['flight_time'] = Time::init(
|
$input['flight_time'] = Time::init(
|
||||||
$input['minutes'],
|
$input['minutes'],
|
||||||
$input['hours'])->getMinutes();
|
$input['hours']
|
||||||
|
)->getMinutes();
|
||||||
|
|
||||||
$input['active'] = get_truth_state($input['active']);
|
$input['active'] = get_truth_state($input['active']);
|
||||||
|
|
||||||
@@ -355,7 +356,9 @@ class FlightController extends Controller
|
|||||||
|
|
||||||
if ($request->isMethod('post')) {
|
if ($request->isMethod('post')) {
|
||||||
$path = Storage::putFileAs(
|
$path = Storage::putFileAs(
|
||||||
'import', $request->file('csv_file'), 'import_flights.csv'
|
'import',
|
||||||
|
$request->file('csv_file'),
|
||||||
|
'import_flights.csv'
|
||||||
);
|
);
|
||||||
|
|
||||||
$path = storage_path('app/'.$path);
|
$path = storage_path('app/'.$path);
|
||||||
|
|||||||
@@ -365,7 +365,8 @@ class PirepController extends Controller
|
|||||||
// Fix the time
|
// Fix the time
|
||||||
$attrs['flight_time'] = Time::init(
|
$attrs['flight_time'] = Time::init(
|
||||||
$attrs['minutes'],
|
$attrs['minutes'],
|
||||||
$attrs['hours'])->getMinutes();
|
$attrs['hours']
|
||||||
|
)->getMinutes();
|
||||||
|
|
||||||
$pirep = $this->pirepRepo->update($attrs, $id);
|
$pirep = $this->pirepRepo->update($attrs, $id);
|
||||||
|
|
||||||
|
|||||||
@@ -304,7 +304,9 @@ class SubfleetController extends Controller
|
|||||||
ImportRequest::validate($request);
|
ImportRequest::validate($request);
|
||||||
|
|
||||||
$path = Storage::putFileAs(
|
$path = Storage::putFileAs(
|
||||||
'import', $request->file('csv_file'), 'import_subfleets.csv'
|
'import',
|
||||||
|
$request->file('csv_file'),
|
||||||
|
'import_subfleets.csv'
|
||||||
);
|
);
|
||||||
|
|
||||||
$path = storage_path('app/'.$path);
|
$path = storage_path('app/'.$path);
|
||||||
|
|||||||
@@ -59,9 +59,13 @@ class LoginController extends Controller
|
|||||||
// Redirect to one of the error pages
|
// Redirect to one of the error pages
|
||||||
if ($user->state === UserState::PENDING) {
|
if ($user->state === UserState::PENDING) {
|
||||||
return view('auth.pending');
|
return view('auth.pending');
|
||||||
} elseif ($user->state === UserState::REJECTED) {
|
}
|
||||||
|
|
||||||
|
if ($user->state === UserState::REJECTED) {
|
||||||
return view('auth.rejected');
|
return view('auth.rejected');
|
||||||
} elseif ($user->state === UserState::SUSPENDED) {
|
}
|
||||||
|
|
||||||
|
if ($user->state === UserState::SUSPENDED) {
|
||||||
return view('auth.suspended');
|
return view('auth.suspended');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ class ResetPasswordController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function showResetForm(Request $request, $token = null)
|
public function showResetForm(Request $request, $token = null)
|
||||||
{
|
{
|
||||||
return view('auth.passwords.reset',
|
return view(
|
||||||
|
'auth.passwords.reset',
|
||||||
['token' => $token, 'email' => $request->email]
|
['token' => $token, 'email' => $request->email]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -406,7 +406,8 @@ class PirepController extends Controller
|
|||||||
// Fix the time
|
// Fix the time
|
||||||
$attrs['flight_time'] = Time::init(
|
$attrs['flight_time'] = Time::init(
|
||||||
$attrs['minutes'],
|
$attrs['minutes'],
|
||||||
$attrs['hours'])->getMinutes();
|
$attrs['hours']
|
||||||
|
)->getMinutes();
|
||||||
|
|
||||||
$pirep = $this->pirepRepo->update($attrs, $id);
|
$pirep = $this->pirepRepo->update($attrs, $id);
|
||||||
|
|
||||||
|
|||||||
@@ -108,8 +108,10 @@ class NotificationEvents extends Listener
|
|||||||
|
|
||||||
if ($event->old_state === UserState::PENDING) {
|
if ($event->old_state === UserState::PENDING) {
|
||||||
if ($event->user->state === UserState::ACTIVE) {
|
if ($event->user->state === UserState::ACTIVE) {
|
||||||
$email = new \App\Mail\UserRegistered($event->user,
|
$email = new \App\Mail\UserRegistered(
|
||||||
'Your registration has been accepted!');
|
$event->user,
|
||||||
|
'Your registration has been accepted!'
|
||||||
|
);
|
||||||
} elseif ($event->user->state === UserState::REJECTED) {
|
} elseif ($event->user->state === UserState::REJECTED) {
|
||||||
$email = new \App\Mail\UserRejected($event->user);
|
$email = new \App\Mail\UserRejected($event->user);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,7 +114,8 @@ class Acars extends Model
|
|||||||
{
|
{
|
||||||
if ($value instanceof Distance) {
|
if ($value instanceof Distance) {
|
||||||
$this->attributes['distance'] = $value->toUnit(
|
$this->attributes['distance'] = $value->toUnit(
|
||||||
config('phpvms.internal_units.distance'));
|
config('phpvms.internal_units.distance')
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
$this->attributes['distance'] = $value;
|
$this->attributes['distance'] = $value;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,15 +76,19 @@ Route::group([
|
|||||||
Route::resource('subfleets', 'SubfleetController');
|
Route::resource('subfleets', 'SubfleetController');
|
||||||
|
|
||||||
Route::resource('users', 'UserController');
|
Route::resource('users', 'UserController');
|
||||||
Route::get('users/{id}/regen_apikey',
|
Route::get(
|
||||||
'UserController@regen_apikey')->name('users.regen_apikey');
|
'users/{id}/regen_apikey',
|
||||||
|
'UserController@regen_apikey'
|
||||||
|
)->name('users.regen_apikey');
|
||||||
|
|
||||||
// defaults
|
// defaults
|
||||||
Route::get('', ['uses' => 'DashboardController@index']);
|
Route::get('', ['uses' => 'DashboardController@index']);
|
||||||
Route::get('/', ['uses' => 'DashboardController@index']);
|
Route::get('/', ['uses' => 'DashboardController@index']);
|
||||||
|
|
||||||
Route::get('dashboard', ['uses' => 'DashboardController@index', 'name' => 'dashboard']);
|
Route::get('dashboard', ['uses' => 'DashboardController@index', 'name' => 'dashboard']);
|
||||||
Route::match(['get', 'post', 'delete'],
|
Route::match(
|
||||||
'dashboard/news', ['uses' => 'DashboardController@news'])
|
['get', 'post', 'delete'],
|
||||||
->name('dashboard.news');
|
'dashboard/news',
|
||||||
|
['uses' => 'DashboardController@news']
|
||||||
|
)->name('dashboard.news');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ class ExportService extends Service
|
|||||||
{
|
{
|
||||||
$writer = Writer::createFromPath($path, 'w+');
|
$writer = Writer::createFromPath($path, 'w+');
|
||||||
CharsetConverter::addTo($writer, 'utf-8', 'iso-8859-15');
|
CharsetConverter::addTo($writer, 'utf-8', 'iso-8859-15');
|
||||||
|
|
||||||
return $writer;
|
return $writer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,8 +78,7 @@ class ExportService extends Service
|
|||||||
*/
|
*/
|
||||||
public function exportAircraft($aircraft)
|
public function exportAircraft($aircraft)
|
||||||
{
|
{
|
||||||
$exporter = new AircraftExporter();
|
return $this->runExport($aircraft, new AircraftExporter());
|
||||||
return $this->runExport($aircraft, $exporter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -92,8 +92,7 @@ class ExportService extends Service
|
|||||||
*/
|
*/
|
||||||
public function exportAirports($airports)
|
public function exportAirports($airports)
|
||||||
{
|
{
|
||||||
$exporter = new AirportExporter();
|
return $this->runExport($airports, new AirportExporter());
|
||||||
return $this->runExport($airports, $exporter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -107,8 +106,7 @@ class ExportService extends Service
|
|||||||
*/
|
*/
|
||||||
public function exportExpenses($expenses)
|
public function exportExpenses($expenses)
|
||||||
{
|
{
|
||||||
$exporter = new ExpenseExporter();
|
return $this->runExport($expenses, new ExpenseExporter());
|
||||||
return $this->runExport($expenses, $exporter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -122,8 +120,7 @@ class ExportService extends Service
|
|||||||
*/
|
*/
|
||||||
public function exportFares($fares)
|
public function exportFares($fares)
|
||||||
{
|
{
|
||||||
$exporter = new FareExporter();
|
return $this->runExport($fares, new FareExporter());
|
||||||
return $this->runExport($fares, $exporter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -137,8 +134,7 @@ class ExportService extends Service
|
|||||||
*/
|
*/
|
||||||
public function exportFlights($flights)
|
public function exportFlights($flights)
|
||||||
{
|
{
|
||||||
$exporter = new FlightExporter();
|
return $this->runExport($flights, new FlightExporter());
|
||||||
return $this->runExport($flights, $exporter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -152,7 +148,6 @@ class ExportService extends Service
|
|||||||
*/
|
*/
|
||||||
public function exportSubfleets($subfleets)
|
public function exportSubfleets($subfleets)
|
||||||
{
|
{
|
||||||
$exporter = new SubfleetExporter();
|
return $this->runExport($subfleets, new SubfleetExporter());
|
||||||
return $this->runExport($subfleets, $exporter);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,7 +113,9 @@ class GeoService extends Service
|
|||||||
|
|
||||||
if ($size === 0) {
|
if ($size === 0) {
|
||||||
continue;
|
continue;
|
||||||
} elseif ($size === 1) {
|
}
|
||||||
|
|
||||||
|
if ($size === 1) {
|
||||||
$point = $points[0];
|
$point = $points[0];
|
||||||
Log::debug('name: '.$point->id.' - '.$point->lat.'x'.$point->lon);
|
Log::debug('name: '.$point->id.' - '.$point->lat.'x'.$point->lon);
|
||||||
$coords[] = $point;
|
$coords[] = $point;
|
||||||
@@ -306,7 +308,8 @@ class GeoService extends Service
|
|||||||
$flight->dpt_airport->icao,
|
$flight->dpt_airport->icao,
|
||||||
$flight->arr_airport->icao,
|
$flight->arr_airport->icao,
|
||||||
[$flight->dpt_airport->lat, $flight->dpt_airport->lon],
|
[$flight->dpt_airport->lat, $flight->dpt_airport->lon],
|
||||||
$flight->route);
|
$flight->route
|
||||||
|
);
|
||||||
|
|
||||||
// lat, lon needs to be reversed for GeoJSON
|
// lat, lon needs to be reversed for GeoJSON
|
||||||
foreach ($all_route_points as $point) {
|
foreach ($all_route_points as $point) {
|
||||||
|
|||||||
@@ -276,23 +276,28 @@ class PirepService extends Service
|
|||||||
if ($pirep->state === PirepState::PENDING) {
|
if ($pirep->state === PirepState::PENDING) {
|
||||||
if ($new_state === PirepState::ACCEPTED) {
|
if ($new_state === PirepState::ACCEPTED) {
|
||||||
return $this->accept($pirep);
|
return $this->accept($pirep);
|
||||||
} elseif ($new_state === PirepState::REJECTED) {
|
}
|
||||||
|
|
||||||
|
if ($new_state === PirepState::REJECTED) {
|
||||||
return $this->reject($pirep);
|
return $this->reject($pirep);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $pirep;
|
return $pirep;
|
||||||
} /*
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
* Move from a ACCEPTED to REJECTED status
|
* Move from a ACCEPTED to REJECTED status
|
||||||
*/
|
*/
|
||||||
elseif ($pirep->state === PirepState::ACCEPTED) {
|
if ($pirep->state === PirepState::ACCEPTED) {
|
||||||
$pirep = $this->reject($pirep);
|
$pirep = $this->reject($pirep);
|
||||||
|
|
||||||
return $pirep;
|
return $pirep;
|
||||||
} /*
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
* Move from REJECTED to ACCEPTED
|
* Move from REJECTED to ACCEPTED
|
||||||
*/
|
*/
|
||||||
elseif ($pirep->state === PirepState::REJECTED) {
|
if ($pirep->state === PirepState::REJECTED) {
|
||||||
$pirep = $this->accept($pirep);
|
$pirep = $this->accept($pirep);
|
||||||
|
|
||||||
return $pirep;
|
return $pirep;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -625,7 +625,6 @@ class Metar implements \ArrayAccess
|
|||||||
$minute = (int) $found[3];
|
$minute = (int) $found[3];
|
||||||
|
|
||||||
if ($this->result['observed_date'] === null) {
|
if ($this->result['observed_date'] === null) {
|
||||||
|
|
||||||
// Take one month, if the observed day is greater than the current day
|
// Take one month, if the observed day is greater than the current day
|
||||||
if ($day > date('j')) {
|
if ($day > date('j')) {
|
||||||
$month = date('n') - 1;
|
$month = date('n') - 1;
|
||||||
|
|||||||
+44
-40
@@ -7,58 +7,62 @@
|
|||||||
"minimum-stability": "stable",
|
"minimum-stability": "stable",
|
||||||
"homepage": "http://www.phpvms.net",
|
"homepage": "http://www.phpvms.net",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.1",
|
"php": ">=7.2",
|
||||||
"ext-calendar": "*",
|
"ext-calendar": "*",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
"ext-pdo": "*",
|
"ext-pdo": "*",
|
||||||
"composer/composer": "1.8.x",
|
"composer/composer": "1.8.*",
|
||||||
"composer/semver": "1.4.x",
|
"composer/semver": "1.4.*",
|
||||||
"akaunting/money": "1.0.x",
|
"akaunting/money": "1.0.*",
|
||||||
"anhskohbo/no-captcha": "3.0.x",
|
"anhskohbo/no-captcha": "3.0.*",
|
||||||
"arrilot/laravel-widgets": "3.13.x",
|
"appstract/laravel-opcache": "^2.0",
|
||||||
|
"arrilot/laravel-widgets": "3.13.*",
|
||||||
"fzaninotto/faker": "^1.8",
|
"fzaninotto/faker": "^1.8",
|
||||||
"guzzlehttp/guzzle": "6.3.x",
|
"guzzlehttp/guzzle": "6.3.*",
|
||||||
"hashids/hashids": "2.0.x",
|
"hashids/hashids": "2.0.*",
|
||||||
"igaster/laravel-theme": "2.0.x",
|
"igaster/laravel-theme": "2.0.*",
|
||||||
"intervention/image": "2.4.x",
|
"intervention/image": "2.4.*",
|
||||||
"irazasyed/laravel-gamp": "1.3.x",
|
"irazasyed/laravel-gamp": "1.3.*",
|
||||||
"jackiedo/timezonelist": "5.x",
|
"jackiedo/timezonelist": "5.*",
|
||||||
"jmikola/geojson": "1.0.x",
|
"jmikola/geojson": "1.0.*",
|
||||||
"joshbrw/laravel-module-installer": "0.1.x",
|
"joshbrw/laravel-module-installer": "0.1.*",
|
||||||
"laracasts/flash": "3.0.x",
|
"laracasts/flash": "3.0.*",
|
||||||
"laravel/framework": "5.7.x",
|
"laravel/framework": "5.8.*",
|
||||||
"laravelcollective/html": "5.7.x",
|
"laravel/helpers": "^1.0",
|
||||||
"league/csv": "9.2.x",
|
"laravelcollective/html": "^5.8",
|
||||||
"league/geotools": "0.8.x",
|
"league/csv": "9.2.*",
|
||||||
"league/iso3166": "2.1.x",
|
"league/geotools": "0.8.*",
|
||||||
|
"league/iso3166": "2.1.*",
|
||||||
"markrogoyski/math-php": "^0.38.0",
|
"markrogoyski/math-php": "^0.38.0",
|
||||||
"myclabs/deep-copy": "1.8.x",
|
"myclabs/deep-copy": "1.8.*",
|
||||||
"nabeel/vacentral": "1.x",
|
"nabeel/vacentral": "1.*",
|
||||||
"nwidart/laravel-modules": "3.3.x",
|
"nwidart/laravel-modules": "5.*",
|
||||||
"php-units-of-measure/php-units-of-measure": "2.1.x",
|
"php-units-of-measure/php-units-of-measure": "2.1.*",
|
||||||
"pragmarx/version": "0.2.x",
|
"pragmarx/version": "0.2.*",
|
||||||
"prettus/l5-repository": "2.6.x",
|
"predis/predis": "^1.1",
|
||||||
"santigarcor/laratrust": "5.0.x",
|
"prettus/l5-repository": "2.6.*",
|
||||||
"sebastiaanluca/laravel-helpers": "1.0.x",
|
"santigarcor/laratrust": "5.2.*",
|
||||||
"spatie/laravel-pjax": "1.3.x",
|
"sebastiaanluca/laravel-helpers": "3.*",
|
||||||
|
"spatie/laravel-pjax": "1.3.*",
|
||||||
"symfony/polyfill-iconv": "^1.11",
|
"symfony/polyfill-iconv": "^1.11",
|
||||||
"theiconic/php-ga-measurement-protocol": "2.7.x",
|
"theiconic/php-ga-measurement-protocol": "2.7.*",
|
||||||
"tivie/php-os-detector": "1.1.x",
|
"tivie/php-os-detector": "1.1.*",
|
||||||
"toin0u/geotools-laravel": "1.0.x",
|
"toin0u/geotools-laravel": "1.0.*",
|
||||||
"vierbergenlars/php-semver": "3.0.x",
|
"vierbergenlars/php-semver": "3.0.*",
|
||||||
"waavi/sanitizer": "1.0.x",
|
"waavi/sanitizer": "1.0.*",
|
||||||
"webpatser/laravel-uuid": "3.x"
|
"webpatser/laravel-uuid": "3.*"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "7.5.x",
|
|
||||||
"barryvdh/laravel-ide-helper": "^2.0",
|
|
||||||
"barryvdh/laravel-debugbar": "^3.0",
|
"barryvdh/laravel-debugbar": "^3.0",
|
||||||
"mockery/mockery": "0.9.*",
|
"barryvdh/laravel-ide-helper": "^2.0",
|
||||||
"filp/whoops": "~2.0",
|
|
||||||
"bpocallaghan/generators": "5.0.1",
|
"bpocallaghan/generators": "5.0.1",
|
||||||
|
"codedungeon/phpunit-result-printer": "^0.13.0",
|
||||||
|
"filp/whoops": "~2.0",
|
||||||
|
"mockery/mockery": "0.9.*",
|
||||||
"nunomaduro/collision": "^2.0",
|
"nunomaduro/collision": "^2.0",
|
||||||
"codedungeon/phpunit-result-printer": "^0.13.0"
|
"phpunit/phpunit": "7.5.*",
|
||||||
|
"squizlabs/php_codesniffer": "3.*"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"classmap": [
|
"classmap": [
|
||||||
|
|||||||
Generated
+954
-701
File diff suppressed because it is too large
Load Diff
@@ -67,7 +67,6 @@ return [
|
|||||||
Collective\Html\HtmlServiceProvider::class,
|
Collective\Html\HtmlServiceProvider::class,
|
||||||
Laracasts\Flash\FlashServiceProvider::class,
|
Laracasts\Flash\FlashServiceProvider::class,
|
||||||
Prettus\Repository\Providers\RepositoryServiceProvider::class,
|
Prettus\Repository\Providers\RepositoryServiceProvider::class,
|
||||||
SebastiaanLuca\Helpers\Methods\GlobalHelpersServiceProvider::class,
|
|
||||||
SebastiaanLuca\Helpers\Collections\CollectionMacrosServiceProvider::class,
|
SebastiaanLuca\Helpers\Collections\CollectionMacrosServiceProvider::class,
|
||||||
Toin0u\Geotools\GeotoolsServiceProvider::class,
|
Toin0u\Geotools\GeotoolsServiceProvider::class,
|
||||||
Jackiedo\Timezonelist\TimezonelistServiceProvider::class,
|
Jackiedo\Timezonelist\TimezonelistServiceProvider::class,
|
||||||
|
|||||||
@@ -24,8 +24,6 @@ return [
|
|||||||
],
|
],
|
||||||
|
|
||||||
'stores' => [
|
'stores' => [
|
||||||
|
|
||||||
'apc' => ['driver' => 'apc'],
|
|
||||||
'array' => ['driver' => 'array'],
|
'array' => ['driver' => 'array'],
|
||||||
'database' => [
|
'database' => [
|
||||||
'driver' => 'database',
|
'driver' => 'database',
|
||||||
@@ -61,6 +59,5 @@ return [
|
|||||||
'driver' => 'redis',
|
'driver' => 'redis',
|
||||||
'connection' => 'default',
|
'connection' => 'default',
|
||||||
],
|
],
|
||||||
|
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
+21
-1
@@ -27,7 +27,27 @@ return [
|
|||||||
| Defines if Laratrust will use Laravel's Cache to cache the roles and permissions.
|
| Defines if Laratrust will use Laravel's Cache to cache the roles and permissions.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'use_cache' => true,
|
'cache' => [
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Use cache in the package
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Defines if Laratrust will use Laravel's Cache to cache the roles and permissions.
|
||||||
|
| NOTE: Currently the database check does not use cache.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'enabled' => true,
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Time to store in cache Laratrust's roles and permissions.
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Determines the time in SECONDS to store Laratrust's roles and permissions in the cache.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'expiration_time' => 3600,
|
||||||
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'url' => env('OPCACHE_URL', config('app.url')),
|
||||||
|
'verify_ssl' => true,
|
||||||
|
'headers' => [],
|
||||||
|
'directories' => [
|
||||||
|
base_path('app'),
|
||||||
|
base_path('bootstrap'),
|
||||||
|
base_path('public'),
|
||||||
|
base_path('resources/lang'),
|
||||||
|
base_path('routes'),
|
||||||
|
base_path('storage/framework/views'),
|
||||||
|
base_path('vendor/appstract'),
|
||||||
|
base_path('vendor/composer'),
|
||||||
|
base_path('vendor/laravel/framework'),
|
||||||
|
],
|
||||||
|
];
|
||||||
+27
-27
@@ -10,15 +10,15 @@ return [
|
|||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Define available themes. Format:
|
| Define available themes. Format:
|
||||||
|
|
|
|
||||||
| 'theme-name' => [
|
| 'theme-name' => [
|
||||||
| 'extends' => 'theme-to-extend', // optional
|
| 'extends' => 'theme-to-extend', // optional
|
||||||
| 'views-path' => 'path-to-views', // defaults to: resources/views/theme-name
|
| 'views-path' => 'path-to-views', // defaults to: resources/views/theme-name
|
||||||
| 'asset-path' => 'path-to-assets', // defaults to: public/theme-name
|
| 'asset-path' => 'path-to-assets', // defaults to: public/theme-name
|
||||||
|
|
|
|
||||||
| // You can add your own custom keys
|
| // You can add your own custom keys
|
||||||
| // Use Theme::getSetting('key') & Theme::setSetting('key', 'value') to access them
|
| // Use Theme::getSetting('key') & Theme::setSetting('key', 'value') to access them
|
||||||
| 'key' => 'value',
|
| 'key' => 'value',
|
||||||
| ],
|
| ],
|
||||||
|
|
|
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@@ -29,37 +29,37 @@ return [
|
|||||||
'extends' => 'false',
|
'extends' => 'false',
|
||||||
],
|
],
|
||||||
|
|
||||||
// Add your themes here. These settings will override theme.json settings defined for each theme
|
// Add your themes here. These settings will override theme.json settings defined for each theme
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|---------------------------[ Example Structure ]--------------------------
|
|---------------------------[ Example Structure ]--------------------------
|
||||||
|
|
|
|
||||||
| // Full theme Syntax:
|
| // Full theme Syntax:
|
||||||
|
|
|
|
||||||
| 'example1' => [
|
| 'example1' => [
|
||||||
| 'extends' => null, // doesn't extend any theme
|
| 'extends' => null, // doesn't extend any theme
|
||||||
| 'views-path' => example, // = resources/views/example_theme
|
| 'views-path' => example, // = resources/views/example_theme
|
||||||
| 'asset-path' => example, // = public/example_theme
|
| 'asset-path' => example, // = public/example_theme
|
||||||
| ],
|
| ],
|
||||||
|
|
|
|
||||||
| // Use all Defaults:
|
| // Use all Defaults:
|
||||||
|
|
|
|
||||||
| 'example2', // Assets =\public\example2, Views =\resources\views\example2
|
| 'example2', // Assets =\public\example2, Views =\resources\views\example2
|
||||||
| // Note that if you use all default values, you can omit declaration completely.
|
| // Note that if you use all default values, you can omit declaration completely.
|
||||||
| // i.e. defaults will be used when you call Theme::set('undefined-theme')
|
| // i.e. defaults will be used when you call Theme::set('undefined-theme')
|
||||||
|
|
|
|
||||||
|
|
|
|
||||||
| // This theme shares the views with example2 but defines its own assets in \public\example3
|
| // This theme shares the views with example2 but defines its own assets in \public\example3
|
||||||
|
|
|
|
||||||
| 'example3' => [
|
| 'example3' => [
|
||||||
| 'views-path' => 'example',
|
| 'views-path' => 'example',
|
||||||
| ],
|
| ],
|
||||||
|
|
|
|
||||||
| // This theme extends example1 and may override SOME views\assets in its own paths
|
| // This theme extends example1 and may override SOME views\assets in its own paths
|
||||||
|
|
|
|
||||||
| 'example4' => [
|
| 'example4' => [
|
||||||
| 'extends' => 'example1',
|
| 'extends' => 'example1',
|
||||||
| ],
|
| ],
|
||||||
|
|
|
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|||||||
+8
-4
@@ -7,22 +7,23 @@ services:
|
|||||||
context: ./docker/php
|
context: ./docker/php
|
||||||
environment:
|
environment:
|
||||||
DB_HOST: mysql
|
DB_HOST: mysql
|
||||||
|
REDIS_HOST: redis
|
||||||
volumes:
|
volumes:
|
||||||
- ./:/var/www
|
- ./:/var/www
|
||||||
- ./docker/php/www.conf:/usr/local/etc/php-fpm.d/www.conf
|
- ./docker/php/www.conf:/usr/local/etc/php-fpm.d/www.conf
|
||||||
depends_on:
|
depends_on:
|
||||||
|
- nginx
|
||||||
- mysql
|
- mysql
|
||||||
|
- redis
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
image: nginx:1.13.8
|
image: nginx:1.15.12-alpine
|
||||||
command: /bin/bash -c "exec nginx -g 'daemon off;'"
|
command: /bin/sh -c "exec nginx -g 'daemon off;'"
|
||||||
volumes:
|
volumes:
|
||||||
- ./:/var/www
|
- ./:/var/www
|
||||||
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
|
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
|
||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 80:80
|
||||||
depends_on:
|
|
||||||
- app
|
|
||||||
|
|
||||||
mysql:
|
mysql:
|
||||||
image: mysql:5.7.26
|
image: mysql:5.7.26
|
||||||
@@ -37,6 +38,9 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 3306:3306
|
- 3306:3306
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: redis:5.0.4-alpine
|
||||||
|
|
||||||
# Use this to tail the logs so it's just all in a single window
|
# Use this to tail the logs so it's just all in a single window
|
||||||
logs:
|
logs:
|
||||||
image: busybox
|
image: busybox
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
FROM php:7.3-fpm
|
FROM php:7.3-fpm-alpine
|
||||||
|
|
||||||
RUN apt-get update
|
#RUN apt-get update
|
||||||
RUN apt-get install -y libgmp-dev
|
#RUN apt-get install -y libgmp-dev
|
||||||
|
RUN apk add gmp-dev
|
||||||
|
|
||||||
|
# Copy any config files in
|
||||||
|
COPY ext-opcache.ini $PHP_INI_DIR/conf.d/
|
||||||
|
|
||||||
RUN ln -sf /dev/stderr /var/log/fpm-error.log
|
RUN ln -sf /dev/stderr /var/log/fpm-error.log
|
||||||
|
|
||||||
RUN docker-php-ext-install \
|
RUN docker-php-ext-install \
|
||||||
mysqli \
|
|
||||||
pdo \
|
|
||||||
pdo_mysql \
|
pdo_mysql \
|
||||||
gmp
|
gmp \
|
||||||
|
opcache
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
[opcache]
|
||||||
|
opcache.enable = 1
|
||||||
|
opcache.memory_consumption = 128
|
||||||
|
opcache.interned_strings_buffer = 8
|
||||||
|
opcache.max_accelerated_files = 4000
|
||||||
|
opcache.revalidate_freq = 60
|
||||||
|
opcache.fast_shutdown = 1
|
||||||
|
opcache.enable_cli = 1
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
'php' => [
|
'php' => [
|
||||||
'version' => '7.1.3'
|
'version' => '7.2'
|
||||||
],
|
],
|
||||||
|
|
||||||
'extensions' => [
|
'extensions' => [
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@
|
|||||||
</whitelist>
|
</whitelist>
|
||||||
</filter>
|
</filter>
|
||||||
<php>
|
<php>
|
||||||
<env name="APP_ENV" value="testing"/>
|
<env name="APP_ENV" value="test"/>
|
||||||
<env name="APP_KEY" value="base64:ve66Z5Kt/zTN3p++0zOPu854PHfZkwJE5VuoFAlzHtI="/>
|
<env name="APP_KEY" value="base64:ve66Z5Kt/zTN3p++0zOPu854PHfZkwJE5VuoFAlzHtI="/>
|
||||||
<env name="APP_DEBUG" value="true"/>
|
<env name="APP_DEBUG" value="true"/>
|
||||||
<env name="APP_LOG_LEVEL" value="debug"/>
|
<env name="APP_LOG_LEVEL" value="debug"/>
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ class AcarsTest extends TestCase
|
|||||||
{
|
{
|
||||||
protected $settingsRepo;
|
protected $settingsRepo;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->addData('base');
|
$this->addData('base');
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@ use App\Services\FareService;
|
|||||||
*/
|
*/
|
||||||
class ApiTest extends TestCase
|
class ApiTest extends TestCase
|
||||||
{
|
{
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->addData('base');
|
$this->addData('base');
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class AwardsTest extends TestCase
|
|||||||
private $awardSvc;
|
private $awardSvc;
|
||||||
private $pirepSvc;
|
private $pirepSvc;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->awardSvc = app(\App\Services\AwardService::class);
|
$this->awardSvc = app(\App\Services\AwardService::class);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class FinanceTest extends TestCase
|
|||||||
/**
|
/**
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->addData('base');
|
$this->addData('base');
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class FlightTest extends TestCase
|
|||||||
protected $flightSvc;
|
protected $flightSvc;
|
||||||
protected $settingsRepo;
|
protected $settingsRepo;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->addData('base');
|
$this->addData('base');
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class ImporterTest extends TestCase
|
|||||||
private $importSvc;
|
private $importSvc;
|
||||||
private $fareSvc;
|
private $fareSvc;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->importBaseClass = new \App\Interfaces\ImportExport();
|
$this->importBaseClass = new \App\Interfaces\ImportExport();
|
||||||
|
|||||||
@@ -4,10 +4,6 @@ use App\Support\Math;
|
|||||||
|
|
||||||
class MathTest extends TestCase
|
class MathTest extends TestCase
|
||||||
{
|
{
|
||||||
public function setUp()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test adding/subtracting a percentage
|
* Test adding/subtracting a percentage
|
||||||
*/
|
*/
|
||||||
|
|||||||
+2
-2
@@ -10,9 +10,9 @@ class MetarTest extends TestCase
|
|||||||
{
|
{
|
||||||
private $settingsRepo;
|
private $settingsRepo;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
parent::setUp(); // TODO: Change the autogenerated stub
|
parent::setUp();
|
||||||
$this->settingsRepo = app(SettingRepository::class);
|
$this->settingsRepo = app(SettingRepository::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -15,9 +15,9 @@ class PIREPTest extends TestCase
|
|||||||
protected $pirepSvc;
|
protected $pirepSvc;
|
||||||
protected $settingsRepo;
|
protected $settingsRepo;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
parent::setUp(); // TODO: Change the autogenerated stub
|
parent::setUp();
|
||||||
$this->addData('base');
|
$this->addData('base');
|
||||||
|
|
||||||
$this->pirepSvc = app('App\Services\PirepService');
|
$this->pirepSvc = app('App\Services\PirepService');
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ class SubfleetTest extends TestCase
|
|||||||
protected $ac_svc;
|
protected $ac_svc;
|
||||||
protected $ICAO = 'B777';
|
protected $ICAO = 'B777';
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->addData('base');
|
$this->addData('base');
|
||||||
|
|||||||
+7
-2
@@ -19,7 +19,7 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
|
|||||||
|
|
||||||
protected $app;
|
protected $app;
|
||||||
protected $baseUrl = 'http://localhost';
|
protected $baseUrl = 'http://localhost';
|
||||||
protected $connectionsToTransact = ['testing'];
|
protected $connectionsToTransact = ['test'];
|
||||||
|
|
||||||
protected $user;
|
protected $user;
|
||||||
|
|
||||||
@@ -30,13 +30,18 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
|
|||||||
/**
|
/**
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function setUp()
|
public function setUp() : void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
Artisan::call('database:create', ['--reset' => true]);
|
Artisan::call('database:create', ['--reset' => true]);
|
||||||
Artisan::call('migrate:refresh', ['--env' => 'unittest']);
|
Artisan::call('migrate:refresh', ['--env' => 'unittest']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function tearDown() : void
|
||||||
|
{
|
||||||
|
parent::tearDown();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates the application. Required to be implemented
|
* Creates the application. Required to be implemented
|
||||||
*
|
*
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ class UserTest extends TestCase
|
|||||||
protected $settingsRepo;
|
protected $settingsRepo;
|
||||||
protected $userSvc;
|
protected $userSvc;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->userSvc = app(UserService::class);
|
$this->userSvc = app(UserService::class);
|
||||||
|
|||||||
@@ -4,10 +4,6 @@ use App\Facades\Utils;
|
|||||||
|
|
||||||
class UtilsTest extends TestCase
|
class UtilsTest extends TestCase
|
||||||
{
|
{
|
||||||
public function setUp()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testDates()
|
public function testDates()
|
||||||
{
|
{
|
||||||
$carbon = new \Carbon\Carbon('2018-04-28T12:55:40Z');
|
$carbon = new \Carbon\Carbon('2018-04-28T12:55:40Z');
|
||||||
|
|||||||
Reference in New Issue
Block a user