You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$content = '<html><body><pre>Content which should be replaced</pre></body></html>';
$placeholderContainer = newPlaceholderContainer();
$placeholder = $placeholderContainer->addPlaceholder('Content which should be replaced');
$result = str_replace('Content which should be replaced', $placeholder, $content);
Desired:
$content = '<html><body><pre>Content which should be replaced</pre></body></html>';
$placeholderContainer = newPlaceholderContainer();
$result = $placeholderContainer->addPlaceholder('Content which should be replaced', $content);
In lots of cases the API is used for doing something like this which makes sense:
returnpreg_replace_callback($pattern, function ($match) use ($placeholderContainer) {
return$placeholderContainer->addPlaceholder($match[1]);
}, $contents);
The original addPlaceholder function should be renamed to createPlaceholder() with the same method definition.
The text was updated successfully, but these errors were encountered:
The
PlaceholderContainer
has a bad API.Current:
Desired:
In lots of cases the API is used for doing something like this which makes sense:
The original
addPlaceholder
function should be renamed tocreatePlaceholder()
with the same method definition.The text was updated successfully, but these errors were encountered: