Code cleanup

This commit is contained in:
James Cole
2021-03-21 09:15:40 +01:00
parent da1751940e
commit 206845575c
317 changed files with 7418 additions and 7362 deletions

View File

@@ -63,6 +63,6 @@ class AccessTokenCreatedMail extends Mailable
public function build(): self
{
return $this->view('v1.emails.access-token-created-html')->text('v1.emails.access-token-created-text')
->subject((string) trans('email.access_token_created_subject'));
->subject((string)trans('email.access_token_created_subject'));
}
}

View File

@@ -62,6 +62,6 @@ class AdminTestMail extends Mailable
public function build(): self
{
return $this->view('v1.emails.admin-test-html')->text('v1.emails.admin-test-text')
->subject((string) trans('email.admin_test_subject'));
->subject((string)trans('email.admin_test_subject'));
}
}

View File

@@ -70,6 +70,6 @@ class ConfirmEmailChangeMail extends Mailable
public function build(): self
{
return $this->view('v1.emails.confirm-email-change-html')->text('v1.emails.confirm-email-change-text')
->subject((string) trans('email.email_change_subject'));
->subject((string)trans('email.email_change_subject'));
}
}

View File

@@ -55,9 +55,10 @@ class NewIPAddressWarningMail extends Mailable
{
use Queueable, SerializesModels;
public string $host;
public string $ipAddress;
public string $time;
public string $host;
/**
* OAuthTokenCreatedMail constructor.
*
@@ -78,12 +79,12 @@ class NewIPAddressWarningMail extends Mailable
// time
$this->time = now()->formatLocalized((string)trans('config.date_time'));
$this->host = '';
$hostName = gethostbyaddr($this->ipAddress);
if($hostName !== $this->ipAddress) {
$hostName = gethostbyaddr($this->ipAddress);
if ($hostName !== $this->ipAddress) {
$this->host = $hostName;
}
return $this->view('v1.emails.new-ip-html')->text('v1.emails.new-ip-text')
->subject((string) trans('email.login_from_new_ip'));
->subject((string)trans('email.login_from_new_ip'));
}
}

View File

@@ -67,6 +67,6 @@ class OAuthTokenCreatedMail extends Mailable
public function build(): self
{
return $this->view('v1.emails.oauth-client-created-html')->text('v1.emails.oauth-client-created-text')
->subject((string) trans('email.oauth_created_subject'));
->subject((string)trans('email.oauth_created_subject'));
}
}

View File

@@ -37,6 +37,7 @@ use Illuminate\Queue\SerializesModels;
class RegisteredUser extends Mailable
{
use Queueable, SerializesModels;
/** @var string Email address of user */
public $address;
/** @var string IP address of user */
@@ -61,6 +62,6 @@ class RegisteredUser extends Mailable
*/
public function build(): self
{
return $this->view('v1.emails.registered-html')->text('v1.emails.registered-text')->subject((string) trans('email.registered_subject'));
return $this->view('v1.emails.registered-html')->text('v1.emails.registered-text')->subject((string)trans('email.registered_subject'));
}
}

View File

@@ -40,10 +40,10 @@ class ReportNewJournalsMail extends Mailable
{
use Queueable, SerializesModels;
public string $email;
public string $email;
public Collection $groups;
public string $ipAddress;
public array $transformed;
public string $ipAddress;
public array $transformed;
/**
* ConfirmEmailChangeMail constructor.
@@ -69,7 +69,7 @@ class ReportNewJournalsMail extends Mailable
$this->transform();
return $this->view('v1.emails.report-new-journals-html')->text('v1.emails.report-new-journals-text')
->subject((string) trans_choice('email.new_journals_subject', $this->groups->count()));
->subject((string)trans_choice('email.new_journals_subject', $this->groups->count()));
}
private function transform(): void

View File

@@ -36,6 +36,7 @@ use Illuminate\Queue\SerializesModels;
class RequestedNewPassword extends Mailable
{
use Queueable, SerializesModels;
/** @var string IP address of user */
public $ipAddress;
/** @var string URI of password change link */
@@ -60,6 +61,6 @@ class RequestedNewPassword extends Mailable
*/
public function build(): self
{
return $this->view('v1.emails.password-html')->text('v1.emails.password-text')->subject((string) trans('email.reset_pw_subject'));
return $this->view('v1.emails.password-html')->text('v1.emails.password-text')->subject((string)trans('email.reset_pw_subject'));
}
}

View File

@@ -68,6 +68,6 @@ class UndoEmailChangeMail extends Mailable
public function build(): self
{
return $this->view('v1.emails.undo-email-change-html')->text('v1.emails.undo-email-change-text')
->subject((string) trans('email.email_change_subject'));
->subject((string)trans('email.email_change_subject'));
}
}