Code reordering and reformatting. I should really start employing style CI.

This commit is contained in:
James Cole
2021-09-18 10:26:12 +02:00
parent 9b9d52e99f
commit 4003cea759
344 changed files with 2776 additions and 2605 deletions

View File

@@ -50,7 +50,7 @@ class DestroyController extends Controller
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->repository = app(CurrencyRepositoryInterface::class);
$this->repository = app(CurrencyRepositoryInterface::class);
$this->userRepository = app(UserRepositoryInterface::class);
$this->repository->setUser(auth()->user());
@@ -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.');
throw new FireflyException('200005: You need the "owner" role to do this.');
}
if ($this->repository->currencyInUse($currency)) {
throw new FireflyException('200006: Currency in use.');
throw new FireflyException('200006: Currency in use.');
}
if ($this->repository->isFallbackCurrency($currency)) {
throw new FireflyException('200026: Currency is fallback.');
throw new FireflyException('200026: Currency is fallback.');
}
$this->repository->destroy($currency);

View File

@@ -26,6 +26,7 @@ namespace FireflyIII\Api\V1\Controllers\Models\TransactionCurrency;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Models\TransactionCurrency\UpdateRequest;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use FireflyIII\Repositories\User\UserRepositoryInterface;
@@ -33,6 +34,7 @@ use FireflyIII\Support\Http\Api\AccountFilter;
use FireflyIII\Support\Http\Api\TransactionFilter;
use FireflyIII\Transformers\CurrencyTransformer;
use Illuminate\Http\JsonResponse;
use JsonException;
use League\Fractal\Resource\Item;
/**
@@ -126,7 +128,7 @@ class UpdateController extends Controller
* @param TransactionCurrency $currency
*
* @return JsonResponse
* @throws \FireflyIII\Exceptions\FireflyException
* @throws FireflyException
* @codeCoverageIgnore
*/
public function makeDefault(TransactionCurrency $currency): JsonResponse
@@ -157,8 +159,8 @@ class UpdateController extends Controller
* @param TransactionCurrency $currency
*
* @return JsonResponse
* @throws \FireflyIII\Exceptions\FireflyException
* @throws \JsonException
* @throws FireflyException
* @throws JsonException
*/
public function update(UpdateRequest $request, TransactionCurrency $currency): JsonResponse
{