Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
unione
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
unione
Commits
c18cfb48
Commit
c18cfb48
authored
2 years ago
by
Vlad Denysiuk
Committed by
Ivan Doroshenko
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3322991
by Abyss, Arturo1007: Fix coding standards messages
parent
5c22c478
No related branches found
Branches containing commit
Tags
1.0.0-alpha1
Tags containing commit
1 merge request
!2
Issue #3322991: Fix coding standards messages
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Form/UniOneAdminSettingsForm.php
+9
-9
9 additions, 9 deletions
src/Form/UniOneAdminSettingsForm.php
src/Plugin/Mail/UniOneMail.php
+12
-10
12 additions, 10 deletions
src/Plugin/Mail/UniOneMail.php
with
21 additions
and
19 deletions
src/Form/UniOneAdminSettingsForm.php
+
9
−
9
View file @
c18cfb48
...
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
src/Plugin/Mail/UniOneMail.php
+
12
−
10
View file @
c18cfb48
...
...
@@ -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
,
]);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment