Various code cleanup.

This commit is contained in:
James Cole
2023-12-22 20:12:38 +01:00
parent 067d160c13
commit 581e5d7330
69 changed files with 361 additions and 317 deletions

View File

@@ -40,6 +40,9 @@ use Symfony\Component\HttpFoundation\ParameterBag;
/**
* Class Controller.
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.NumberOfChildren)
*/
abstract class Controller extends BaseController
{

View File

@@ -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 */

View File

@@ -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());

View File

@@ -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();

View File

@@ -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
{