Move isOpeningBalance() to trait

This commit is contained in:
James Cole
2018-08-09 16:13:13 +02:00
parent 7943164375
commit 136f983353
6 changed files with 64 additions and 23 deletions

View File

@@ -29,6 +29,7 @@ use FireflyIII\Models\TransactionJournal;
use FireflyIII\Models\TransactionType;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
use FireflyIII\Support\Http\Controllers\ModelInformation;
use Illuminate\Http\Request;
use Log;
use View;
@@ -38,6 +39,8 @@ use View;
*/
class ConvertController extends Controller
{
use ModelInformation;
/** @var JournalRepositoryInterface Journals and transactions overview */
private $repository;
@@ -181,7 +184,8 @@ class ConvertController extends Controller
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
protected function getDestinationAccount(TransactionJournal $journal, TransactionType $destinationType, array $data): Account // helper for conversion. Get info from obj.
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 +246,8 @@ class ConvertController extends Controller
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
protected function getSourceAccount(TransactionJournal $journal, TransactionType $destinationType, array $data): Account // helper for conversion. Get info from obj.
protected function getSourceAccount(TransactionJournal $journal, TransactionType $destinationType, array $data
): Account // helper for conversion. Get info from obj.
{
/** @var AccountRepositoryInterface $accountRepository */
$accountRepository = app(AccountRepositoryInterface::class);