Strict comparisons.

This commit is contained in:
James Cole
2017-07-15 16:41:07 +02:00
parent c03ab269f0
commit 22144b78ea
59 changed files with 110 additions and 107 deletions

View File

@@ -75,7 +75,7 @@ class CacheProperties
*/
public function has(): bool
{
if (getenv('APP_ENV') == 'testing') {
if (getenv('APP_ENV') === 'testing') {
return false;
}
$this->md5();

View File

@@ -96,7 +96,7 @@ class Navigation
// if the range is custom, the end of the period
// is another X days (x is the difference between start)
// and end added to $theCurrentEnd
if ($repeatFreq == 'custom') {
if ($repeatFreq === 'custom') {
/** @var Carbon $tStart */
$tStart = session('start', Carbon::now()->startOfMonth());
/** @var Carbon $tEnd */
@@ -393,7 +393,7 @@ class Navigation
return $date;
}
if ($repeatFreq == 'half-year' || $repeatFreq == '6M') {
if ($repeatFreq === 'half-year' || $repeatFreq === '6M') {
$month = $date->month;
$date->startOfYear();
if ($month >= 7) {
@@ -496,7 +496,7 @@ class Navigation
return $end;
}
if ($range == '6M') {
if ($range === '6M') {
if ($start->month >= 7) {
$end->endOfYear();
@@ -532,7 +532,7 @@ class Navigation
return $start;
}
if ($range == '6M') {
if ($range === '6M') {
if ($start->month >= 7) {
$start->startOfYear()->addMonths(6);

View File

@@ -110,7 +110,7 @@ class General extends Twig_Extension
$what = $args[2]; // name of the route.
$activeWhat = $context['what'] ?? false;
if ($what == $activeWhat && !(strpos(Route::getCurrentRoute()->getName(), $route) === false)) {
if ($what === $activeWhat && !(strpos(Route::getCurrentRoute()->getName(), $route) === false)) {
return 'active';
}
@@ -132,7 +132,7 @@ class General extends Twig_Extension
$args = func_get_args();
$route = $args[0]; // name of the route.
if (Route::getCurrentRoute()->getName() == $route) {
if (Route::getCurrentRoute()->getName() === $route) {
return 'active';
}

View File

@@ -51,7 +51,7 @@ class Journal extends Twig_Extension
$array = [];
/** @var Account $entry */
foreach ($list as $entry) {
if ($entry->accountType->type == AccountType::CASH) {
if ($entry->accountType->type === AccountType::CASH) {
$array[] = '<span class="text-success">(cash)</span>';
continue;
}
@@ -123,7 +123,7 @@ class Journal extends Twig_Extension
$array = [];
/** @var Account $entry */
foreach ($list as $entry) {
if ($entry->accountType->type == 'Cash account') {
if ($entry->accountType->type === AccountType::CASH) {
$array[] = '<span class="text-success">(cash)</span>';
continue;
}

View File

@@ -70,7 +70,7 @@ class Rule extends Twig_Extension
$ruleTriggers = array_keys(Config::get('firefly.rule-triggers'));
$possibleTriggers = [];
foreach ($ruleTriggers as $key) {
if ($key != 'user_action') {
if ($key !== 'user_action') {
$possibleTriggers[$key] = trans('firefly.rule_trigger_' . $key . '_choice');
}
}