mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-06 12:45:30 +00:00
Code clean up.
This commit is contained in:
@@ -18,7 +18,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Transaction;
|
||||
@@ -37,13 +36,11 @@ use Session;
|
||||
use View;
|
||||
|
||||
/**
|
||||
* Class ConvertController
|
||||
*
|
||||
* @package FireflyIII\Http\Controllers\Transaction
|
||||
* Class ConvertController.
|
||||
*/
|
||||
class ConvertController extends Controller
|
||||
{
|
||||
/** @var AccountRepositoryInterface */
|
||||
/** @var AccountRepositoryInterface */
|
||||
private $accounts;
|
||||
|
||||
/**
|
||||
@@ -117,11 +114,9 @@ class ConvertController extends Controller
|
||||
'sourceType',
|
||||
'subTitle',
|
||||
'subTitleIcon'
|
||||
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
// convert withdrawal to deposit requires a new source account ()
|
||||
// or to transfer requires
|
||||
}
|
||||
@@ -178,6 +173,7 @@ class ConvertController extends Controller
|
||||
* @param array $data
|
||||
*
|
||||
* @return Account
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function getDestinationAccount(TransactionJournal $journal, TransactionType $destinationType, array $data): Account
|
||||
@@ -202,7 +198,7 @@ class ConvertController extends Controller
|
||||
case TransactionType::DEPOSIT . '-' . TransactionType::WITHDRAWAL:
|
||||
case TransactionType::TRANSFER . '-' . TransactionType::WITHDRAWAL:
|
||||
// three and five
|
||||
if ($data['destination_account_expense'] === '' || is_null($data['destination_account_expense'])) {
|
||||
if ('' === $data['destination_account_expense'] || null === $data['destination_account_expense']) {
|
||||
// destination is a cash account.
|
||||
$destination = $accountRepository->getCashAccount();
|
||||
|
||||
@@ -233,6 +229,7 @@ class ConvertController extends Controller
|
||||
* @param array $data
|
||||
*
|
||||
* @return Account
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function getSourceAccount(TransactionJournal $journal, TransactionType $destinationType, array $data): Account
|
||||
@@ -249,7 +246,7 @@ class ConvertController extends Controller
|
||||
case TransactionType::WITHDRAWAL . '-' . TransactionType::DEPOSIT:
|
||||
case TransactionType::TRANSFER . '-' . TransactionType::DEPOSIT:
|
||||
|
||||
if ($data['source_account_revenue'] === '' || is_null($data['source_account_revenue'])) {
|
||||
if ('' === $data['source_account_revenue'] || null === $data['source_account_revenue']) {
|
||||
// destination is a cash account.
|
||||
$destination = $accountRepository->getCashAccount();
|
||||
|
||||
|
Reference in New Issue
Block a user