mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
PHP7 compatible function definitions.
This commit is contained in:
@@ -139,7 +139,7 @@ class Amount
|
||||
}
|
||||
$cache->store(env('DEFAULT_CURRENCY', 'EUR'));
|
||||
|
||||
return env('DEFAULT_CURRENCY', 'EUR'); // @codeCoverageIgnore
|
||||
return env('DEFAULT_CURRENCY', 'EUR');
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -14,7 +14,6 @@ use Preferences as Prefs;
|
||||
/**
|
||||
* Class CacheProperties
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
* @package FireflyIII\Support
|
||||
*/
|
||||
class CacheProperties
|
||||
|
@@ -250,13 +250,11 @@ class ExpandedForm
|
||||
{
|
||||
$previousValue = null;
|
||||
|
||||
// @codeCoverageIgnoreStart
|
||||
try {
|
||||
$previousValue = Input::old('post_submit_action');
|
||||
} catch (RuntimeException $e) {
|
||||
// don't care
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
$previousValue = is_null($previousValue) ? 'store' : $previousValue;
|
||||
$html = view('form.options', compact('type', 'name', 'previousValue'))->render();
|
||||
@@ -391,7 +389,6 @@ class ExpandedForm
|
||||
$preFilled = session('preFilled');
|
||||
$value = isset($preFilled[$name]) && is_null($value) ? $preFilled[$name] : $value;
|
||||
}
|
||||
// @codeCoverageIgnoreStart
|
||||
try {
|
||||
if (!is_null(Input::old($name))) {
|
||||
$value = Input::old($name);
|
||||
@@ -400,7 +397,6 @@ class ExpandedForm
|
||||
// don't care about session errors.
|
||||
}
|
||||
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
@@ -8,7 +8,6 @@ use Illuminate\Support\Facades\Facade;
|
||||
/**
|
||||
* Class Amount
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
* @package FireflyIII\Support\Facades
|
||||
*/
|
||||
class Amount extends Facade
|
||||
|
@@ -8,7 +8,6 @@ use Illuminate\Support\Facades\Facade;
|
||||
/**
|
||||
* Class Amount
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
* @package FireflyIII\Support\Facades
|
||||
*/
|
||||
class ExpandedForm extends Facade
|
||||
|
@@ -8,7 +8,6 @@ use Illuminate\Support\Facades\Facade;
|
||||
/**
|
||||
* Class Navigation
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
* @package FireflyIII\Support\Facades
|
||||
*/
|
||||
class Navigation extends Facade
|
||||
|
@@ -8,7 +8,6 @@ use Illuminate\Support\Facades\Facade;
|
||||
/**
|
||||
* Class Preferences
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
* @package FireflyIII\Support\Facades
|
||||
*/
|
||||
class Preferences extends Facade
|
||||
|
@@ -8,7 +8,6 @@ use Illuminate\Support\Facades\Facade;
|
||||
/**
|
||||
* Class Steam
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
* @package FireflyIII\Support\Facades
|
||||
*/
|
||||
class Steam extends Facade
|
||||
|
@@ -39,7 +39,7 @@ class TransactionJournalSupport extends Model
|
||||
$cache->addProperty('transaction-journal');
|
||||
$cache->addProperty('amount');
|
||||
if ($cache->has()) {
|
||||
return $cache->get(); // @codeCoverageIgnore
|
||||
return $cache->get();
|
||||
}
|
||||
|
||||
$transaction = $journal->transactions->sortByDesc('amount')->first();
|
||||
@@ -66,7 +66,7 @@ class TransactionJournalSupport extends Model
|
||||
$cache->addProperty('transaction-journal');
|
||||
$cache->addProperty('amount-positive');
|
||||
if ($cache->has()) {
|
||||
return $cache->get(); // @codeCoverageIgnore
|
||||
return $cache->get();
|
||||
}
|
||||
|
||||
$amount = '0';
|
||||
@@ -143,7 +143,7 @@ class TransactionJournalSupport extends Model
|
||||
$cache->addProperty('transaction-journal');
|
||||
$cache->addProperty('destination-account');
|
||||
if ($cache->has()) {
|
||||
return $cache->get(); // @codeCoverageIgnore
|
||||
return $cache->get();
|
||||
}
|
||||
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
|
||||
if (!is_null($transaction)) {
|
||||
@@ -168,7 +168,7 @@ class TransactionJournalSupport extends Model
|
||||
$cache->addProperty('transaction-journal');
|
||||
$cache->addProperty('destination-account-type-str');
|
||||
if ($cache->has()) {
|
||||
return $cache->get(); // @codeCoverageIgnore
|
||||
return $cache->get();
|
||||
}
|
||||
|
||||
$account = self::destinationAccount($journal);
|
||||
@@ -225,7 +225,7 @@ class TransactionJournalSupport extends Model
|
||||
$cache->addProperty('transaction-journal');
|
||||
$cache->addProperty('source-account');
|
||||
if ($cache->has()) {
|
||||
return $cache->get(); // @codeCoverageIgnore
|
||||
return $cache->get();
|
||||
}
|
||||
$transaction = $journal->transactions()->where('amount', '<', 0)->first();
|
||||
if (!is_null($transaction)) {
|
||||
@@ -250,7 +250,7 @@ class TransactionJournalSupport extends Model
|
||||
$cache->addProperty('transaction-journal');
|
||||
$cache->addProperty('source-account-type-str');
|
||||
if ($cache->has()) {
|
||||
return $cache->get(); // @codeCoverageIgnore
|
||||
return $cache->get();
|
||||
}
|
||||
|
||||
$account = self::sourceAccount($journal);
|
||||
@@ -272,7 +272,7 @@ class TransactionJournalSupport extends Model
|
||||
$cache->addProperty('transaction-journal');
|
||||
$cache->addProperty('type-string');
|
||||
if ($cache->has()) {
|
||||
return $cache->get(); // @codeCoverageIgnore
|
||||
return $cache->get();
|
||||
}
|
||||
|
||||
$typeStr = $journal->transaction_type_type ?? $journal->transactionType->type;
|
||||
|
@@ -110,7 +110,11 @@ class Preferences
|
||||
{
|
||||
$user = Auth::user();
|
||||
if (is_null($user)) {
|
||||
return $value;
|
||||
// make new preference, return it:
|
||||
$pref = new Preference;
|
||||
$pref->name = $name;
|
||||
$pref->data = $value;
|
||||
return $pref;
|
||||
}
|
||||
|
||||
return $this->setForUser(Auth::user(), $name, $value);
|
||||
|
@@ -35,7 +35,7 @@ class Steam
|
||||
$cache->addProperty($date);
|
||||
$cache->addProperty($ignoreVirtualBalance);
|
||||
if ($cache->has()) {
|
||||
return $cache->get(); // @codeCoverageIgnore
|
||||
return $cache->get();
|
||||
}
|
||||
|
||||
$balance = strval(
|
||||
@@ -72,7 +72,7 @@ class Steam
|
||||
$cache->addProperty($start);
|
||||
$cache->addProperty($end);
|
||||
if ($cache->has()) {
|
||||
return $cache->get(); // @codeCoverageIgnore
|
||||
return $cache->get();
|
||||
}
|
||||
|
||||
$balances = [];
|
||||
@@ -119,7 +119,7 @@ class Steam
|
||||
$cache->addProperty('balances');
|
||||
$cache->addProperty($date);
|
||||
if ($cache->has()) {
|
||||
return $cache->get(); // @codeCoverageIgnore
|
||||
return $cache->get();
|
||||
}
|
||||
|
||||
$balances = Transaction::
|
||||
|
@@ -10,7 +10,6 @@ use Twig_Extension;
|
||||
use Twig_SimpleFunction;
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* Class Budget
|
||||
*
|
||||
* @package FireflyIII\Support\Twig
|
||||
@@ -29,7 +28,7 @@ class Budget extends Twig_Extension
|
||||
$cache->addProperty($repetition->id);
|
||||
$cache->addProperty('spentInRepetition');
|
||||
if ($cache->has()) {
|
||||
return $cache->get(); // @codeCoverageIgnore
|
||||
return $cache->get();
|
||||
}
|
||||
$sum
|
||||
= Auth::user()->transactionjournals()
|
||||
|
@@ -14,7 +14,6 @@ use Twig_SimpleFilter;
|
||||
use Twig_SimpleFunction;
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* Class TwigSupport
|
||||
*
|
||||
|
@@ -8,7 +8,6 @@ use Twig_Extension;
|
||||
use Twig_SimpleFunction;
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* Class PiggyBank
|
||||
*
|
||||
|
@@ -7,7 +7,6 @@ use Twig_Extension;
|
||||
use Twig_SimpleFilter;
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* Class Budget
|
||||
*
|
||||
|
Reference in New Issue
Block a user