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:
@@ -40,6 +40,9 @@ use Symfony\Component\HttpFoundation\ParameterBag;
|
||||
|
||||
/**
|
||||
* Class Controller.
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
* @SuppressWarnings(PHPMD.NumberOfChildren)
|
||||
*/
|
||||
abstract class Controller extends BaseController
|
||||
{
|
||||
|
@@ -71,7 +71,7 @@ class ShowController extends Controller
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @throws FireflyException
|
||||
* */
|
||||
*/
|
||||
public function index(): JsonResponse
|
||||
{
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
@@ -101,7 +101,7 @@ class ShowController extends Controller
|
||||
* Show a currency.
|
||||
*
|
||||
* @throws FireflyException
|
||||
* */
|
||||
*/
|
||||
public function show(TransactionCurrency $currency): JsonResponse
|
||||
{
|
||||
/** @var User $user */
|
||||
@@ -129,7 +129,7 @@ class ShowController extends Controller
|
||||
* Show a currency.
|
||||
*
|
||||
* @throws FireflyException
|
||||
* */
|
||||
*/
|
||||
public function showDefault(): JsonResponse
|
||||
{
|
||||
/** @var User $user */
|
||||
|
@@ -68,7 +68,7 @@ class StoreController extends Controller
|
||||
* Store new currency.
|
||||
*
|
||||
* @throws FireflyException
|
||||
* */
|
||||
*/
|
||||
public function store(StoreRequest $request): JsonResponse
|
||||
{
|
||||
$currency = $this->repository->store($request->getAll());
|
||||
|
@@ -69,7 +69,7 @@ class UpdateController extends Controller
|
||||
* Disable a currency.
|
||||
*
|
||||
* @throws FireflyException
|
||||
* */
|
||||
*/
|
||||
public function disable(TransactionCurrency $currency): JsonResponse
|
||||
{
|
||||
// must be unused.
|
||||
@@ -133,7 +133,7 @@ class UpdateController extends Controller
|
||||
* Enable a currency.
|
||||
*
|
||||
* @throws FireflyException
|
||||
* */
|
||||
*/
|
||||
public function enable(TransactionCurrency $currency): JsonResponse
|
||||
{
|
||||
$this->repository->enable($currency);
|
||||
@@ -160,7 +160,7 @@ class UpdateController extends Controller
|
||||
* Update a currency.
|
||||
*
|
||||
* @throws FireflyException
|
||||
* */
|
||||
*/
|
||||
public function update(UpdateRequest $request, TransactionCurrency $currency): JsonResponse
|
||||
{
|
||||
$data = $request->getAll();
|
||||
|
@@ -45,6 +45,9 @@ use Symfony\Component\HttpFoundation\ParameterBag;
|
||||
|
||||
/**
|
||||
* Class Controller
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
* @SuppressWarnings(PHPMD.NumberOfChildren)
|
||||
*/
|
||||
class Controller extends BaseController
|
||||
{
|
||||
@@ -104,6 +107,8 @@ class Controller extends BaseController
|
||||
/**
|
||||
* TODO duplicate from V1 controller
|
||||
* Method to grab all parameters from the URL.
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.NPathComplexity)
|
||||
*/
|
||||
private function getParameters(): ParameterBag
|
||||
{
|
||||
|
Reference in New Issue
Block a user