PHP7 compatible function definitions.

This commit is contained in:
James Cole
2016-04-06 09:27:45 +02:00
parent 37fe2d22b0
commit c8440af9a5
77 changed files with 278 additions and 345 deletions

View File

@@ -139,7 +139,7 @@ class Amount
}
$cache->store(env('DEFAULT_CURRENCY', 'EUR'));
return env('DEFAULT_CURRENCY', 'EUR'); // @codeCoverageIgnore
return env('DEFAULT_CURRENCY', 'EUR');
}
}

View File

@@ -14,7 +14,6 @@ use Preferences as Prefs;
/**
* Class CacheProperties
*
* @codeCoverageIgnore
* @package FireflyIII\Support
*/
class CacheProperties

View File

@@ -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;
}

View File

@@ -8,7 +8,6 @@ use Illuminate\Support\Facades\Facade;
/**
* Class Amount
*
* @codeCoverageIgnore
* @package FireflyIII\Support\Facades
*/
class Amount extends Facade

View File

@@ -8,7 +8,6 @@ use Illuminate\Support\Facades\Facade;
/**
* Class Amount
*
* @codeCoverageIgnore
* @package FireflyIII\Support\Facades
*/
class ExpandedForm extends Facade

View File

@@ -8,7 +8,6 @@ use Illuminate\Support\Facades\Facade;
/**
* Class Navigation
*
* @codeCoverageIgnore
* @package FireflyIII\Support\Facades
*/
class Navigation extends Facade

View File

@@ -8,7 +8,6 @@ use Illuminate\Support\Facades\Facade;
/**
* Class Preferences
*
* @codeCoverageIgnore
* @package FireflyIII\Support\Facades
*/
class Preferences extends Facade

View File

@@ -8,7 +8,6 @@ use Illuminate\Support\Facades\Facade;
/**
* Class Steam
*
* @codeCoverageIgnore
* @package FireflyIII\Support\Facades
*/
class Steam extends Facade

View File

@@ -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;

View File

@@ -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);

View File

@@ -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::

View File

@@ -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()

View File

@@ -14,7 +14,6 @@ use Twig_SimpleFilter;
use Twig_SimpleFunction;
/**
* @codeCoverageIgnore
*
* Class TwigSupport
*

View File

@@ -8,7 +8,6 @@ use Twig_Extension;
use Twig_SimpleFunction;
/**
* @codeCoverageIgnore
*
* Class PiggyBank
*

View File

@@ -7,7 +7,6 @@ use Twig_Extension;
use Twig_SimpleFilter;
/**
* @codeCoverageIgnore
*
* Class Budget
*