Various code cleanup.

This commit is contained in:
James Cole
2021-04-07 07:28:43 +02:00
parent 4ddcb0c965
commit f12744ad8c
180 changed files with 714 additions and 721 deletions

View File

@@ -96,7 +96,7 @@ class UpdateController extends Controller
$selectedGroup = $collector->getGroups()->first();
if (null === $selectedGroup) {
throw new NotFoundHttpException(); // @codeCoverageIgnore
throw new NotFoundHttpException();
}
/** @var TransactionGroupTransformer $transformer */
$transformer = app(TransactionGroupTransformer::class);

View File

@@ -75,13 +75,13 @@ class DestroyController extends Controller
if (!$this->userRepository->hasRole($admin, 'owner')) {
// access denied:
throw new FireflyException('200005: You need the "owner" role to do this.'); // @codeCoverageIgnore
throw new FireflyException('200005: You need the "owner" role to do this.');
}
if ($this->repository->currencyInUse($currency)) {
throw new FireflyException('200006: Currency in use.'); // @codeCoverageIgnore
throw new FireflyException('200006: Currency in use.');
}
if ($this->repository->isFallbackCurrency($currency)) {
throw new FireflyException('200026: Currency is fallback.'); // @codeCoverageIgnore
throw new FireflyException('200026: Currency is fallback.');
}
$this->repository->destroy($currency);

View File

@@ -80,7 +80,7 @@ class StoreController extends Controller
$admin = auth()->user();
if (!$this->userRepository->hasRole($admin, 'owner')) {
throw new FireflyException('200005: You need the "owner" role to do this.'); // @codeCoverageIgnore
throw new FireflyException('200005: You need the "owner" role to do this.');
}
$data = $request->getAll();
// if currency ID is 0, find the currency by the code:

View File

@@ -86,7 +86,7 @@ class UpdateController extends Controller
$admin = auth()->user();
if (!$this->userRepository->hasRole($admin, 'owner')) {
throw new FireflyException('200005: You need the "owner" role to do this.'); // @codeCoverageIgnore
throw new FireflyException('200005: You need the "owner" role to do this.');
}
$data = $request->getAll();