mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-04 03:43:07 +00:00
Various code cleanup.
This commit is contained in:
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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:
|
||||
|
@@ -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();
|
||||
|
Reference in New Issue
Block a user