From dc2570a4080b39cecbce82273bbb18f4824f7170 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Tue, 6 Mar 2018 17:36:06 -0600 Subject: [PATCH] Rename the PirepService class --- app/Http/Controllers/Admin/PirepController.php | 6 +++--- app/Http/Controllers/Api/PirepController.php | 6 +++--- app/Http/Controllers/Frontend/PirepController.php | 6 +++--- app/Services/Finance/PirepFinanceService.php | 6 +++--- app/Services/{PIREPService.php => PirepService.php} | 10 +++++++--- tests/FinanceTest.php | 4 ++-- tests/PIREPTest.php | 2 +- 7 files changed, 22 insertions(+), 18 deletions(-) rename app/Services/{PIREPService.php => PirepService.php} (98%) diff --git a/app/Http/Controllers/Admin/PirepController.php b/app/Http/Controllers/Admin/PirepController.php index c0b04fef..fbfbcbe4 100644 --- a/app/Http/Controllers/Admin/PirepController.php +++ b/app/Http/Controllers/Admin/PirepController.php @@ -17,7 +17,7 @@ use App\Repositories\PirepFieldRepository; use App\Repositories\PirepRepository; use App\Repositories\SubfleetRepository; use App\Services\FareService; -use App\Services\PIREPService; +use App\Services\PirepService; use App\Services\UserService; use App\Support\Units\Time; use Flash; @@ -50,7 +50,7 @@ class PirepController extends BaseController * @param JournalRepository $journalRepo * @param PirepRepository $pirepRepo * @param PirepFieldRepository $pirepFieldRepo - * @param PIREPService $pirepSvc + * @param PirepService $pirepSvc * @param SubfleetRepository $subfleetRepo * @param UserService $userSvc */ @@ -62,7 +62,7 @@ class PirepController extends BaseController JournalRepository $journalRepo, PirepRepository $pirepRepo, PirepFieldRepository $pirepFieldRepo, - PIREPService $pirepSvc, + PirepService $pirepSvc, SubfleetRepository $subfleetRepo, UserService $userSvc ) { diff --git a/app/Http/Controllers/Api/PirepController.php b/app/Http/Controllers/Api/PirepController.php index 43c108ca..fcc96330 100644 --- a/app/Http/Controllers/Api/PirepController.php +++ b/app/Http/Controllers/Api/PirepController.php @@ -28,7 +28,7 @@ use App\Repositories\JournalRepository; use App\Repositories\PirepRepository; use App\Services\Finance\PirepFinanceService; use App\Services\GeoService; -use App\Services\PIREPService; +use App\Services\PirepService; use App\Services\UserService; use Auth; use Illuminate\Http\Request; @@ -51,7 +51,7 @@ class PirepController extends RestController * @param GeoService $geoSvc * @param JournalRepository $journalRepo * @param PirepRepository $pirepRepo - * @param PIREPService $pirepSvc + * @param PirepService $pirepSvc * @param UserService $userSvc */ public function __construct( @@ -60,7 +60,7 @@ class PirepController extends RestController GeoService $geoSvc, JournalRepository $journalRepo, PirepRepository $pirepRepo, - PIREPService $pirepSvc, + PirepService $pirepSvc, UserService $userSvc ) { $this->acarsRepo = $acarsRepo; diff --git a/app/Http/Controllers/Frontend/PirepController.php b/app/Http/Controllers/Frontend/PirepController.php index 8967c004..538ea03d 100644 --- a/app/Http/Controllers/Frontend/PirepController.php +++ b/app/Http/Controllers/Frontend/PirepController.php @@ -17,7 +17,7 @@ use App\Repositories\PirepFieldRepository; use App\Repositories\PirepRepository; use App\Services\FareService; use App\Services\GeoService; -use App\Services\PIREPService; +use App\Services\PirepService; use App\Services\UserService; use App\Support\Units\Time; use Flash; @@ -47,7 +47,7 @@ class PirepController extends Controller * @param GeoService $geoSvc * @param PirepRepository $pirepRepo * @param PirepFieldRepository $pirepFieldRepo - * @param PIREPService $pirepSvc + * @param PirepService $pirepSvc * @param UserService $userSvc */ public function __construct( @@ -58,7 +58,7 @@ class PirepController extends Controller GeoService $geoSvc, PirepRepository $pirepRepo, PirepFieldRepository $pirepFieldRepo, - PIREPService $pirepSvc, + PirepService $pirepSvc, UserService $userSvc ) { $this->aircraftRepo = $aircraftRepo; diff --git a/app/Services/Finance/PirepFinanceService.php b/app/Services/Finance/PirepFinanceService.php index 6a5c04ac..acac6f46 100644 --- a/app/Services/Finance/PirepFinanceService.php +++ b/app/Services/Finance/PirepFinanceService.php @@ -11,7 +11,7 @@ use App\Repositories\ExpenseRepository; use App\Repositories\JournalRepository; use App\Services\BaseService; use App\Services\FareService; -use App\Services\PIREPService; +use App\Services\PirepService; use App\Support\Math; use App\Support\Money; use Log; @@ -33,13 +33,13 @@ class PirepFinanceService extends BaseService * @param ExpenseRepository $expenseRepo * @param FareService $fareSvc * @param JournalRepository $journalRepo - * @param PIREPService $pirepSvc + * @param PirepService $pirepSvc */ public function __construct( ExpenseRepository $expenseRepo, FareService $fareSvc, JournalRepository $journalRepo, - PIREPService $pirepSvc + PirepService $pirepSvc ) { $this->expenseRepo = $expenseRepo; $this->fareSvc = $fareSvc; diff --git a/app/Services/PIREPService.php b/app/Services/PirepService.php similarity index 98% rename from app/Services/PIREPService.php rename to app/Services/PirepService.php index 1e7e0d3e..b4d9f91d 100644 --- a/app/Services/PIREPService.php +++ b/app/Services/PirepService.php @@ -12,7 +12,6 @@ use App\Models\Enums\PirepSource; use App\Models\Enums\PirepState; use App\Models\Navdata; use App\Models\Pirep; -use App\Models\PirepFare; use App\Models\PirepFieldValues; use App\Models\User; use App\Repositories\AcarsRepository; @@ -23,7 +22,11 @@ use Carbon\Carbon; use Illuminate\Database\Eloquent\ModelNotFoundException; use Log; -class PIREPService extends BaseService +/** + * Class PirepService + * @package App\Services + */ +class PirepService extends BaseService { private $acarsRepo, $flightRepo, @@ -33,8 +36,9 @@ class PIREPService extends BaseService $pirepRepo; /** - * PIREPService constructor. + * PirepService constructor. * @param AcarsRepository $acarsRepo + * @param FlightRepository $flightRepo * @param GeoService $geoSvc * @param NavdataRepository $navRepo * @param PirepRepository $pirepRepo diff --git a/tests/FinanceTest.php b/tests/FinanceTest.php index 1b543e9c..e7bb273b 100644 --- a/tests/FinanceTest.php +++ b/tests/FinanceTest.php @@ -2,7 +2,7 @@ use App\Models\Enums\ExpenseType; use App\Repositories\ExpenseRepository; -use App\Services\PIREPService; +use App\Services\PirepService; use App\Repositories\JournalRepository; use App\Services\FareService; use App\Services\Finance\PirepFinanceService; @@ -30,7 +30,7 @@ class FinanceTest extends TestCase $this->fareSvc = app(FareService::class); $this->financeSvc = app(PirepFinanceService::class); $this->fleetSvc = app(FleetService::class); - $this->pirepSvc = app(PIREPService::class); + $this->pirepSvc = app(PirepService::class); } /** diff --git a/tests/PIREPTest.php b/tests/PIREPTest.php index 4e4a6b28..38a18e96 100644 --- a/tests/PIREPTest.php +++ b/tests/PIREPTest.php @@ -17,7 +17,7 @@ class PIREPTest extends TestCase parent::setUp(); // TODO: Change the autogenerated stub $this->addData('base'); - $this->pirepSvc = app('App\Services\PIREPService'); + $this->pirepSvc = app('App\Services\PirepService'); $this->settingsRepo = app(SettingRepository::class); }