mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 22:21:42 +00:00
Some code cleanup courtesy of PHPStorm.
This commit is contained in:
@@ -136,7 +136,7 @@ class Amount
|
||||
{
|
||||
$currency = $transaction->transactionJournal->transactionCurrency;
|
||||
|
||||
return $this->formatAnything($currency, $transaction->amount);
|
||||
return $this->formatAnything($currency, $transaction->amount, $coloured);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,7 +19,6 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
* @package FireflyIII\Support\Binder
|
||||
*/
|
||||
class CategoryList implements BinderInterface
|
||||
|
||||
{
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
namespace FireflyIII\Support\Binder;
|
||||
|
||||
use Auth;
|
||||
use Carbon\Carbon;
|
||||
use Exception;
|
||||
use Log;
|
||||
|
||||
@@ -28,7 +28,7 @@ class Steam
|
||||
$set = Auth::user()->transactions()
|
||||
->whereIn('account_id', $accounts)
|
||||
->groupBy('account_id')
|
||||
->get(['transactions.account_id', DB::Raw('MAX(`transaction_journals`.`date`) as `max_date`')]);
|
||||
->get(['transactions.account_id', DB::raw('MAX(`transaction_journals`.`date`) as `max_date`')]);
|
||||
|
||||
foreach ($set as $entry) {
|
||||
$list[intval($entry->account_id)] = new Carbon($entry->max_date);
|
||||
|
||||
@@ -8,18 +8,18 @@ use Twig_SimpleFunction;
|
||||
|
||||
/**
|
||||
* Class Rule
|
||||
*
|
||||
* @package FireflyIII\Support\Twig
|
||||
*/
|
||||
class Rule extends Twig_Extension
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
$functions = [];
|
||||
|
||||
$functions[] = new Twig_SimpleFunction(
|
||||
/**
|
||||
* @return Twig_SimpleFunction
|
||||
*/
|
||||
public function allJournalTriggers()
|
||||
{
|
||||
return new Twig_SimpleFunction(
|
||||
'allJournalTriggers', function () {
|
||||
return [
|
||||
'store-journal' => trans('firefly.rule_trigger_store_journal'),
|
||||
@@ -27,8 +27,14 @@ class Rule extends Twig_Extension
|
||||
];
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
$functions[] = new Twig_SimpleFunction(
|
||||
/**
|
||||
* @return Twig_SimpleFunction
|
||||
*/
|
||||
public function allRuleTriggers()
|
||||
{
|
||||
return new Twig_SimpleFunction(
|
||||
'allRuleTriggers', function () {
|
||||
$ruleTriggers = array_keys(Config::get('firefly.rule-triggers'));
|
||||
$possibleTriggers = [];
|
||||
@@ -44,7 +50,15 @@ class Rule extends Twig_Extension
|
||||
|
||||
);
|
||||
|
||||
$functions[] = new Twig_SimpleFunction('allRuleActions', function () {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Twig_SimpleFunction
|
||||
*/
|
||||
public function allActionTriggers()
|
||||
{
|
||||
return new Twig_SimpleFunction(
|
||||
'allRuleActions', function () {
|
||||
// array of valid values for actions
|
||||
$ruleActions = array_keys(Config::get('firefly.rule-actions'));
|
||||
$possibleActions = [];
|
||||
@@ -54,9 +68,21 @@ class Rule extends Twig_Extension
|
||||
unset($key, $ruleActions);
|
||||
|
||||
return $possibleActions;
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return [
|
||||
$this->allJournalTriggers(),
|
||||
$this->allRuleTriggers(),
|
||||
$this->allActionTriggers(),
|
||||
];
|
||||
|
||||
return $functions;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user