add tests batch 20
This commit is contained in:
@@ -29,7 +29,7 @@ class ReimbursementRecipientService
|
||||
if ($id <= 0 || in_array($roleName, $excludedRoles, true)) {
|
||||
continue;
|
||||
}
|
||||
if (! isset($staff[$id])) {
|
||||
if (!isset($staff[$id])) {
|
||||
$staff[$id] = [
|
||||
'id' => $id,
|
||||
'firstname' => $row->firstname ?? '',
|
||||
@@ -39,9 +39,8 @@ class ReimbursementRecipientService
|
||||
}
|
||||
|
||||
uasort($staff, static function (array $a, array $b) {
|
||||
$nameA = trim(($a['firstname'] ?? '').' '.($a['lastname'] ?? ''));
|
||||
$nameB = trim(($b['firstname'] ?? '').' '.($b['lastname'] ?? ''));
|
||||
|
||||
$nameA = trim(($a['firstname'] ?? '') . ' ' . ($a['lastname'] ?? ''));
|
||||
$nameB = trim(($b['firstname'] ?? '') . ' ' . ($b['lastname'] ?? ''));
|
||||
return strcasecmp($nameA, $nameB);
|
||||
});
|
||||
|
||||
@@ -56,7 +55,7 @@ class ReimbursementRecipientService
|
||||
public function adminRoster(): array
|
||||
{
|
||||
$admins = $this->staffUsers();
|
||||
if (! empty($admins)) {
|
||||
if (!empty($admins)) {
|
||||
return $admins;
|
||||
}
|
||||
|
||||
@@ -65,12 +64,11 @@ class ReimbursementRecipientService
|
||||
|
||||
public function specialRecipientLabel($value): ?string
|
||||
{
|
||||
if ($value === null || ! is_numeric($value)) {
|
||||
if ($value === null || !is_numeric($value)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$id = (int) $value;
|
||||
|
||||
return self::SPECIAL_RECIPIENTS[$id] ?? null;
|
||||
}
|
||||
|
||||
@@ -81,7 +79,7 @@ class ReimbursementRecipientService
|
||||
}, $users);
|
||||
|
||||
foreach (self::SPECIAL_RECIPIENTS as $id => $label) {
|
||||
if (! in_array($id, $existingIds, true)) {
|
||||
if (!in_array($id, $existingIds, true)) {
|
||||
$users[] = [
|
||||
'id' => $id,
|
||||
'firstname' => $label,
|
||||
|
||||
Reference in New Issue
Block a user