Apply fixes from StyleCI
This commit is contained in:
committed by
StyleCI Bot
parent
20f46adbc4
commit
9596d88b48
@@ -11,19 +11,19 @@ use App\Services\ImportExport\FareExporter;
|
||||
use App\Services\ImportExport\FlightExporter;
|
||||
use App\Services\ImportExport\SubfleetExporter;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use League\Csv\CharsetConverter;
|
||||
use League\Csv\Writer;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class ExportService
|
||||
* @package App\Services
|
||||
*/
|
||||
class ExportService extends Service
|
||||
{
|
||||
/**
|
||||
* @param string $path
|
||||
* @param string $path
|
||||
*
|
||||
* @return Writer
|
||||
*/
|
||||
public function openCsv($path): Writer
|
||||
@@ -35,20 +35,23 @@ class ExportService extends Service
|
||||
|
||||
/**
|
||||
* Run the actual importer
|
||||
*
|
||||
* @param Collection $collection
|
||||
* @param ImportExport $exporter
|
||||
* @return string
|
||||
*
|
||||
* @throws \League\Csv\CannotInsertRecord
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function runExport(Collection $collection, ImportExport $exporter): string
|
||||
{
|
||||
$filename = 'export_' . $exporter->assetType . '.csv';
|
||||
$filename = 'export_'.$exporter->assetType.'.csv';
|
||||
|
||||
// Create the directory - makes it inside of storage/app
|
||||
Storage::makeDirectory('import');
|
||||
$path = storage_path('/app/import/export_'.$filename.'.csv');
|
||||
|
||||
Log::info('Exporting "'.$exporter->assetType.'" to ' . $path);
|
||||
Log::info('Exporting "'.$exporter->assetType.'" to '.$path);
|
||||
|
||||
$writer = $this->openCsv($path);
|
||||
|
||||
@@ -65,9 +68,12 @@ class ExportService extends Service
|
||||
|
||||
/**
|
||||
* Export all of the aircraft
|
||||
*
|
||||
* @param Collection $aircraft
|
||||
* @return mixed
|
||||
*
|
||||
* @throws \League\Csv\CannotInsertRecord
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function exportAircraft($aircraft)
|
||||
{
|
||||
@@ -77,9 +83,12 @@ class ExportService extends Service
|
||||
|
||||
/**
|
||||
* Export all of the airports
|
||||
*
|
||||
* @param Collection $airports
|
||||
* @return mixed
|
||||
*
|
||||
* @throws \League\Csv\CannotInsertRecord
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function exportAirports($airports)
|
||||
{
|
||||
@@ -89,9 +98,12 @@ class ExportService extends Service
|
||||
|
||||
/**
|
||||
* Export all of the airports
|
||||
*
|
||||
* @param Collection $expenses
|
||||
* @return mixed
|
||||
*
|
||||
* @throws \League\Csv\CannotInsertRecord
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function exportExpenses($expenses)
|
||||
{
|
||||
@@ -101,9 +113,12 @@ class ExportService extends Service
|
||||
|
||||
/**
|
||||
* Export all of the fares
|
||||
*
|
||||
* @param Collection $fares
|
||||
* @return mixed
|
||||
*
|
||||
* @throws \League\Csv\CannotInsertRecord
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function exportFares($fares)
|
||||
{
|
||||
@@ -113,9 +128,12 @@ class ExportService extends Service
|
||||
|
||||
/**
|
||||
* Export all of the flights
|
||||
*
|
||||
* @param Collection $flights
|
||||
* @return mixed
|
||||
*
|
||||
* @throws \League\Csv\CannotInsertRecord
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function exportFlights($flights)
|
||||
{
|
||||
@@ -125,9 +143,12 @@ class ExportService extends Service
|
||||
|
||||
/**
|
||||
* Export all of the flights
|
||||
*
|
||||
* @param Collection $subfleets
|
||||
* @return mixed
|
||||
*
|
||||
* @throws \League\Csv\CannotInsertRecord
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function exportSubfleets($subfleets)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user