Skip to content
Snippets Groups Projects
Commit c18cfb48 authored by Vlad Denysiuk's avatar Vlad Denysiuk Committed by Ivan Doroshenko
Browse files

Issue #3322991 by Abyss, Arturo1007: Fix coding standards messages

parent 5c22c478
No related branches found
Tags 1.0.0-alpha1
1 merge request!2Issue #3322991: Fix coding standards messages
......@@ -40,16 +40,16 @@ class UniOneAdminSettingsForm extends ConfigFormBase {
or if you use UniOne European Instance - @eu', [
'@us' => Link::fromTextAndUrl($this->t('dashboard'),
Url::fromUri('https://us1.unione.io/en', [
'attributes' => [
'onclick' => "target='_blank'",
],
]))->toString(),
'attributes' => [
'onclick' => "target='_blank'",
],
]))->toString(),
'@eu' => Link::fromTextAndUrl($this->t('dashboard'),
Url::fromUri('https://eu1.unione.io/en', [
'attributes' => [
'onclick' => "target='_blank'",
],
]))->toString(),
'attributes' => [
'onclick' => "target='_blank'",
],
]))->toString(),
]),
];
......@@ -121,7 +121,7 @@ class UniOneAdminSettingsForm extends ConfigFormBase {
public function submitForm(array &$form, FormStateInterface $form_state) {
$config = $this->config('unione.settings');
$config_keys = [
'api_key', 'endpoint', 'track_click', 'track_read', 'debug_mode'
'api_key', 'endpoint', 'track_click', 'track_read', 'debug_mode',
];
foreach ($config_keys as $config_key) {
......
......@@ -26,8 +26,10 @@ class UniOneMail implements MailInterface, ContainerFactoryPluginInterface {
/**
* A regex that matches a structure like 'Name <email@address.com>'.
*
* It matches anything between the first < and last > as email address.
* This allows to use a single string to construct an Address, which can be convenient to use in
* This allows to use a single string to construct an Address,
* which can be convenient to use in
* config, and allows to have more readable config.
* This does not try to cover all edge cases for address.
*/
......@@ -130,7 +132,7 @@ class UniOneMail implements MailInterface, ContainerFactoryPluginInterface {
if ($decode_response['failed_emails']) {
$failed_emails =& $decode_response['failed_emails'];
array_walk($failed_emails, static function(&$value, $key) {
array_walk($failed_emails, static function (&$value, $key) {
$value = "{$key}: {$value}";
});
......@@ -139,8 +141,8 @@ class UniOneMail implements MailInterface, ContainerFactoryPluginInterface {
'%code' => $decode_response['code'] ? 'Error code: ' . $decode_response['code'] . '.' : '',
'%message' => $decode_response['message'] ? 'Error message: ' . $decode_response['message'] . '.' : '',
'%failed_emails' => $failed_emails
? implode(', ', $failed_emails) . '.'
: '',
? implode(', ', $failed_emails) . '.'
: '',
]);
}
......@@ -180,8 +182,8 @@ class UniOneMail implements MailInterface, ContainerFactoryPluginInterface {
'recipients' => $recipients,
'subject' => $message['subject'],
'body_html' => $message['body'] instanceof MarkupInterface
? $message['body']->__toString()
: $message['body'],
? $message['body']->__toString()
: $message['body'],
'platform' => 'drupal.' . self::VERSION,
];
......@@ -242,7 +244,7 @@ class UniOneMail implements MailInterface, ContainerFactoryPluginInterface {
$attachments[] = [
'type' => $file->getMimeType(),
'name' => $file->getFilename(),
'content' => base64_encode(file_get_contents($file->createFileUrl(false))),
'content' => base64_encode(file_get_contents($file->createFileUrl(FALSE))),
];
}
}
......@@ -267,10 +269,10 @@ class UniOneMail implements MailInterface, ContainerFactoryPluginInterface {
* Method to split email and sender name.
*
* @param string $email
* The email address to validate.
* The email address to validate.
*
* @return array|null
* The email address if it is valid, or an array of error messages.
* The email address if it is valid, or an array of error messages.
*
* @see \Symfony\Component\Mime\Address::create
*/
......@@ -284,7 +286,7 @@ class UniOneMail implements MailInterface, ContainerFactoryPluginInterface {
$this->logger->error('Could not parse "%email" to a "%class" instance.',
[
'%email' => $email,
'%class' => self::class
'%class' => self::class,
]);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment