From 3fa5694bb8e21aa349b3165a8d9f09aebafc3773 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 2 Aug 2020 18:58:44 +0200 Subject: [PATCH] property_exists doesn't seem to work --- app/Factory/TransactionJournalFactory.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Factory/TransactionJournalFactory.php b/app/Factory/TransactionJournalFactory.php index 63a26b31e9..92f18e7dd0 100644 --- a/app/Factory/TransactionJournalFactory.php +++ b/app/Factory/TransactionJournalFactory.php @@ -596,8 +596,8 @@ class TransactionJournalFactory $this->accountValidator->setTransactionType($transactionType); // validate source account. - $sourceId = property_exists($data, 'source_id') ? (int) $data['source_id'] : null; - $sourceName = property_exists($data, 'source_name') ? (string) $data['source_name'] : null; + $sourceId = $data['source_id'] ? (int) $data['source_id'] : null; + $sourceName = $data['source_name'] ? (string) $data['source_name'] : null; $validSource = $this->accountValidator->validateSource($sourceId, $sourceName, null); // do something with result: @@ -606,8 +606,8 @@ class TransactionJournalFactory } Log::debug('Source seems valid.'); // validate destination account - $destinationId = property_exists($data, 'destination_id') ? (int) $data['destination_id'] : null; - $destinationName = property_exists($data, 'destination_name') ? (string) $data['destination_name'] : null; + $destinationId = $data['destination_id'] ? (int) $data['destination_id'] : null; + $destinationName = $data['destination_name'] ? (string) $data['destination_name'] : null; $validDestination = $this->accountValidator->validateDestination($destinationId, $destinationName, null); // do something with result: if (false === $validDestination) {