-
Notifications
You must be signed in to change notification settings - Fork 132
Add ability to use array entities as arguments. #89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
00b21e3
d3ad955
2c38cc6
9bce276
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -496,6 +496,10 @@ private function findAndReplaceReferences($objectHandler, $inputString) | |
|
||
$replacement = $this->resolveParameterization($parameterized, $replacement, $match, $obj); | ||
|
||
if (is_array($replacement)) { | ||
$replacement = '["' . implode('","', $replacement) . '"]'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm aware this would be insufficient escapement but I wasn't sure how far this needed to go. I figured if nothing else this PR serves as a proof of concept and opens the conversation to this feature. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nathanjosiah, by There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @KevinBKozan Unless multidimensional arrays have a use case then I'm not thinking as much about that. I was thinking more about if the items contain quotes or There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gotcha. Let me leave some review comments on some small stuff then! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should array_walk/array_map with |
||
} | ||
|
||
$outputString = str_replace($match, $replacement, $outputString); | ||
} | ||
return $outputString; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check should either live in the elseif block in 497, or in the
resolveEntityDataObjectReference()
function. This conditional only ever applies to EntityDataObjects, so checking it every time is unecessary.