PHP7 compatible type hinting [skip ci]

This commit is contained in:
James Cole
2016-02-18 07:21:48 +01:00
parent 7a7ce7fcea
commit e7be4e3e49
22 changed files with 87 additions and 139 deletions

View File

@@ -17,25 +17,14 @@ use FireflyIII\Models\TransactionJournal;
class ConnectJournalToPiggyBank
{
/**
* Create the event handler.
*
* @codeCoverageIgnore
*
*/
public function __construct()
{
//
}
/**
* Connect a new transaction journal to any related piggy banks.
*
* @param TransactionJournalStored $event
*
* @return boolean
* @return bool
*/
public function handle(TransactionJournalStored $event)
public function handle(TransactionJournalStored $event): bool
{
/** @var TransactionJournal $journal */
$journal = $event->journal;

View File

@@ -26,25 +26,15 @@ use Log;
*/
class FireRulesForStore
{
/**
* Create the event handler.
*
* @codeCoverageIgnore
*
*/
public function __construct()
{
//
}
/**
* Connect a new transaction journal to any related piggy banks.
*
* @param TransactionJournalStored $event
*
* @return boolean
* @return bool
*/
public function handle(TransactionJournalStored $event)
public function handle(TransactionJournalStored $event): bool
{
// get all the user's rule groups, with the rules, order by 'order'.
/** @var User $user */

View File

@@ -25,23 +25,14 @@ use Log;
*/
class FireRulesForUpdate
{
/**
* Create the event handler.
*
*/
public function __construct()
{
//
}
/**
* Handle the event.
*
* @param TransactionJournalUpdated $event
*
* @return void
* @return bool
*/
public function handle(TransactionJournalUpdated $event)
public function handle(TransactionJournalUpdated $event): bool
{
// get all the user's rule groups, with the rules, order by 'order'.
/** @var User $user */
@@ -71,5 +62,6 @@ class FireRulesForUpdate
}
}
return true;
}
}

View File

@@ -22,26 +22,18 @@ use FireflyIII\Support\Events\BillScanner;
class ScanForBillsAfterStore
{
/**
* Create the event handler.
*
*/
public function __construct()
{
//
}
/**
* Scan a transaction journal for possible links to bills, right after storing.
*
* @param TransactionJournalStored $event
*
* @return void
* @return bool
*/
public function handle(TransactionJournalStored $event)
public function handle(TransactionJournalStored $event): bool
{
$journal = $event->journal;
BillScanner::scan($journal);
return true;
}
}

View File

@@ -21,27 +21,18 @@ use FireflyIII\Support\Events\BillScanner;
*/
class ScanForBillsAfterUpdate
{
/**
* Create the event handler.
*
*/
public function __construct()
{
//
}
/**
* Scan a transaction journal for possibly related bills after it has been updated.
*
* @param TransactionJournalUpdated $event
*
* @return void
* @return bool
*/
public function handle(TransactionJournalUpdated $event)
public function handle(TransactionJournalUpdated $event): bool
{
$journal = $event->journal;
BillScanner::scan($journal);
return true;
}
}

View File

@@ -15,23 +15,14 @@ use FireflyIII\Models\PiggyBankRepetition;
class UpdateJournalConnection
{
/**
* Create the event handler.
*
*/
public function __construct()
{
//
}
/**
* Handle the event.
*
* @param TransactionJournalUpdated $event
*
* @return void
* @return bool
*/
public function handle(TransactionJournalUpdated $event)
public function handle(TransactionJournalUpdated $event):bool
{
$journal = $event->journal;
@@ -39,7 +30,7 @@ class UpdateJournalConnection
/** @var PiggyBankEvent $event */
$event = PiggyBankEvent::where('transaction_journal_id', $journal->id)->first();
if (is_null($event)) {
return;
return false;
}
$piggyBank = $event->piggyBank()->first();
$repetition = null;
@@ -49,7 +40,7 @@ class UpdateJournalConnection
}
if (is_null($repetition)) {
return;
return false;
}
bcscale(2);
@@ -62,6 +53,8 @@ class UpdateJournalConnection
$event->amount = $amount;
$event->save();
return true;
}
}