mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Change scope of methods, add some notes. Prep for refactoring.
This commit is contained in:
@@ -181,7 +181,7 @@ class ConvertController extends Controller
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||
*/
|
||||
private function getDestinationAccount(TransactionJournal $journal, TransactionType $destinationType, array $data): Account
|
||||
protected function getDestinationAccount(TransactionJournal $journal, TransactionType $destinationType, array $data): Account // helper for conversion. Get info from obj.
|
||||
{
|
||||
/** @var AccountRepositoryInterface $accountRepository */
|
||||
$accountRepository = app(AccountRepositoryInterface::class);
|
||||
@@ -242,7 +242,7 @@ class ConvertController extends Controller
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||
*/
|
||||
private function getSourceAccount(TransactionJournal $journal, TransactionType $destinationType, array $data): Account
|
||||
protected function getSourceAccount(TransactionJournal $journal, TransactionType $destinationType, array $data): Account // helper for conversion. Get info from obj.
|
||||
{
|
||||
/** @var AccountRepositoryInterface $accountRepository */
|
||||
$accountRepository = app(AccountRepositoryInterface::class);
|
||||
|
@@ -450,7 +450,7 @@ class SingleController extends Controller
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function isSplitJournal(TransactionJournal $journal): bool
|
||||
protected function isSplitJournal(TransactionJournal $journal): bool // validate objects
|
||||
{
|
||||
$count = $this->repository->countTransactions($journal);
|
||||
|
||||
|
@@ -182,7 +182,7 @@ class SplitController extends Controller
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function arrayFromJournal(Request $request, TransactionJournal $journal): array
|
||||
protected function arrayFromJournal(Request $request, TransactionJournal $journal): array // convert user input.
|
||||
{
|
||||
$sourceAccounts = $this->repository->getJournalSourceAccounts($journal);
|
||||
$destinationAccounts = $this->repository->getJournalDestinationAccounts($journal);
|
||||
@@ -232,7 +232,7 @@ class SplitController extends Controller
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||
*/
|
||||
private function getTransactionDataFromJournal(TransactionJournal $journal): array
|
||||
protected function getTransactionDataFromJournal(TransactionJournal $journal): array // convert object
|
||||
{
|
||||
// use collector to collect transactions.
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
@@ -274,7 +274,7 @@ class SplitController extends Controller
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||
*/
|
||||
private function updateWithPrevious($array, $old): array
|
||||
protected function updateWithPrevious($array, $old): array // update object with new info
|
||||
{
|
||||
if (0 === \count($old) || !isset($old['transactions'])) {
|
||||
return $array;
|
||||
|
Reference in New Issue
Block a user