mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Various code cleanup and fixed alignments.
This commit is contained in:
14
app/User.php
14
app/User.php
@@ -422,9 +422,9 @@ class User extends Authenticatable
|
||||
if (method_exists($this, $method)) {
|
||||
return $this->{$method}($notification); // @phpstan-ignore-line
|
||||
}
|
||||
$email = $this->email;
|
||||
$email = $this->email;
|
||||
// see if user has alternative email address:
|
||||
$pref = app('preferences')->getForUser($this, 'remote_guard_alt_email');
|
||||
$pref = app('preferences')->getForUser($this, 'remote_guard_alt_email');
|
||||
if (null !== $pref) {
|
||||
$email = $pref->data;
|
||||
}
|
||||
@@ -462,11 +462,11 @@ class User extends Authenticatable
|
||||
public function routeNotificationForSlack(Notification $notification): string
|
||||
{
|
||||
// this check does not validate if the user is owner, Should be done by notification itself.
|
||||
$res = app('fireflyconfig')->get('slack_webhook_url', '')->data;
|
||||
$res = app('fireflyconfig')->get('slack_webhook_url', '')->data;
|
||||
if (is_array($res)) {
|
||||
$res = '';
|
||||
}
|
||||
$res = (string)$res;
|
||||
$res = (string)$res;
|
||||
if ($notification instanceof TestNotification) {
|
||||
return $res;
|
||||
}
|
||||
@@ -594,14 +594,14 @@ class User extends Authenticatable
|
||||
app('log')->debug(sprintf('in hasAnyRoleInGroup(%s)', implode(', ', $roles)));
|
||||
|
||||
/** @var Collection $dbRoles */
|
||||
$dbRoles = UserRole::whereIn('title', $roles)->get();
|
||||
$dbRoles = UserRole::whereIn('title', $roles)->get();
|
||||
if (0 === $dbRoles->count()) {
|
||||
app('log')->error(sprintf('Could not find role(s): %s. Probably migration mishap.', implode(', ', $roles)));
|
||||
|
||||
return false;
|
||||
}
|
||||
$dbRolesIds = $dbRoles->pluck('id')->toArray();
|
||||
$dbRolesTitles = $dbRoles->pluck('title')->toArray();
|
||||
$dbRolesIds = $dbRoles->pluck('id')->toArray();
|
||||
$dbRolesTitles = $dbRoles->pluck('title')->toArray();
|
||||
|
||||
/** @var Collection $groupMemberships */
|
||||
$groupMemberships = $this->groupMemberships()
|
||||
|
Reference in New Issue
Block a user