Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
migrate_plus
Commits
5c47458c
Unverified
Commit
5c47458c
authored
Feb 23, 2021
by
RoSk0
Browse files
220: Fix options validation
parent
17ff6a56
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Plugin/migrate/process/DomStrReplace.php
View file @
5c47458c
...
...
@@ -84,9 +84,7 @@ class DomStrReplace extends DomProcessBase {
'attribute'
=>
[
'attribute_options'
=>
NULL
,
],
'element'
=>
[
]
'element'
=>
[]
],
'search'
=>
NULL
,
'replace'
=>
NULL
,
...
...
@@ -104,7 +102,7 @@ class DomStrReplace extends DomProcessBase {
sprintf
(
'Configuration option "%s" only accepts the following values: %s.'
,
$option_name
,
implode
(
', '
,
$possible_values
)
implode
(
', '
,
array_keys
(
$possible_values
)
)
)
);
}
...
...
@@ -118,7 +116,7 @@ class DomStrReplace extends DomProcessBase {
"Configuration option '
$option_name
' is required for mode '
$mode
'."
);
}
if
(
is_null
(
$possible_values
)
&&
!
in_array
(
$this
->
configuration
[
$option_name
],
$possible_values
))
{
if
(
!
is_null
(
$possible_values
)
&&
!
in_array
(
$this
->
configuration
[
$option_name
],
$possible_values
))
{
throw
new
InvalidPluginDefinitionException
(
$this
->
getPluginId
(),
sprintf
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment