Fix issues proposed by sonar (#986)

This commit is contained in:
Alexis Saettler
2018-03-08 22:37:27 +01:00
committed by GitHub
parent 83fbc5fc48
commit 558515b59a
37 changed files with 86 additions and 91 deletions
+6 -5
View File
@@ -266,7 +266,7 @@ class ContactsController extends Controller
$specialDate = $contact->setSpecialDate('deceased_date', $request->input('deceased_date_year'), $request->input('deceased_date_month'), $request->input('deceased_date_day'));
if ($request->input('addReminderDeceased') != '') {
$newReminder = $specialDate->setReminder('year', 1, trans('people.deceased_reminder_title', ['name' => $contact->first_name]));
$specialDate->setReminder('year', 1, trans('people.deceased_reminder_title', ['name' => $contact->first_name]));
}
}
}
@@ -276,8 +276,6 @@ class ContactsController extends Controller
// Handling the case of the birthday
$contact->removeSpecialDate('birthdate');
switch ($request->input('birthdate')) {
case 'unknown':
break;
case 'approximate':
$specialDate = $contact->setSpecialDateFromAge('birthdate', $request->input('age'));
break;
@@ -288,7 +286,7 @@ class ContactsController extends Controller
$request->input('month'),
$request->input('day')
);
$newReminder = $specialDate->setReminder('year', 1, trans('people.people_add_birthday_reminder', ['name' => $contact->first_name]));
$specialDate->setReminder('year', 1, trans('people.people_add_birthday_reminder', ['name' => $contact->first_name]));
break;
case 'exact':
$birthdate = $request->input('birthdayDate');
@@ -299,7 +297,10 @@ class ContactsController extends Controller
$birthdate->month,
$birthdate->day
);
$newReminder = $specialDate->setReminder('year', 1, trans('people.people_add_birthday_reminder', ['name' => $contact->first_name]));
$specialDate->setReminder('year', 1, trans('people.people_add_birthday_reminder', ['name' => $contact->first_name]));
break;
case 'unknown':
default:
break;
}