Skip to content

Commit

Permalink
Merge branch 'MDL-73869-master' of https://github.com/dravek/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
sarjona committed Feb 15, 2022
2 parents 256804d + af84b16 commit a708139
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions reportbuilder/classes/local/report/action.php
Expand Up @@ -61,7 +61,7 @@ final class action {
*
* @param moodle_url $url
* @param pix_icon $icon
* @param array $attributes
* @param string[] $attributes Array of attributes to include in action, each will be cast to string prior to use
* @param bool $popup
* @param ?lang_string $title
*/
Expand Down Expand Up @@ -136,15 +136,15 @@ public function get_action_link(stdClass $row): ?string {
/**
* Given an array of values, replace all placeholders with corresponding property of the given row
*
* @param array $values
* @param string[] $values
* @param stdClass $row
* @return array
*/
private static function replace_placeholders(array $values, stdClass $row): array {
return array_map(static function($value) use ($row) {
return preg_replace_callback('/^:(?<property>.*)$/', static function(array $matches) use ($row): string {
return (string) ($row->{$matches['property']} ?? '');
}, $value);
}, (string) $value);
}, $values);
}
}

0 comments on commit a708139

Please sign in to comment.