1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-24 09:55:33 +02:00

MDL-67115 core: php74 params order for implode()/join()

Passing parameters to implode() in reverse order is deprecated, use
implode($glue, $parts) instead of implode($parts, $glue).

This commit corresponds to phpunit and manual detections, core files.
This commit is contained in:
Eloy Lafuente (stronk7) 2019-11-03 22:59:10 +01:00
parent fd126006b0
commit ee439d017e
13 changed files with 18 additions and 18 deletions

@ -1290,7 +1290,7 @@ class core_admin_renderer extends plugin_renderer_base {
if ($unavailable or $unknown) {
$out .= $this->output->heading(get_string('misdepsunavail', 'core_plugin'));
if ($unknown) {
$out .= $this->output->notification(get_string('misdepsunknownlist', 'core_plugin', implode($unknown, ', ')));
$out .= $this->output->notification(get_string('misdepsunknownlist', 'core_plugin', implode(', ', $unknown)));
}
if ($unavailable) {
$unavailablelist = array();
@ -1305,7 +1305,7 @@ class core_admin_renderer extends plugin_renderer_base {
$unavailablelist[] = $unavailablelistitem;
}
$out .= $this->output->notification(get_string('misdepsunavaillist', 'core_plugin',
implode($unavailablelist, ', ')));
implode(', ', $unavailablelist)));
}
$out .= $this->output->container_start('plugins-check-dependencies-actions');
$out .= ' '.html_writer::link(new moodle_url('/admin/tool/installaddon/'),
@ -1425,7 +1425,7 @@ class core_admin_renderer extends plugin_renderer_base {
html_writer::div($plugin->name, 'name').' '.html_writer::div($plugin->component, 'component'),
$plugin->version->release,
$plugin->version->version,
implode($supportedmoodles, ' '),
implode(' ', $supportedmoodles),
$info
);
}
@ -2037,7 +2037,7 @@ class core_admin_renderer extends plugin_renderer_base {
if (empty($CFG->docroot) or $environment_result->plugin) {
$report = get_string($stringtouse, 'admin', $rec);
} else {
$report = $this->doc_link(join($linkparts, '/'), get_string($stringtouse, 'admin', $rec), true);
$report = $this->doc_link(join('/', $linkparts), get_string($stringtouse, 'admin', $rec), true);
}
// Enclose report text in div so feedback text will be displayed underneath it.
$report = html_writer::div($report);

@ -288,7 +288,7 @@ class completion_criteria_activity extends completion_criteria {
}
}
$details['requirement'] = implode($details['requirement'], ', ');
$details['requirement'] = implode(', ', $details['requirement']);
$details['status'] = '';

@ -160,7 +160,7 @@ class filter_tex extends moodle_text_filter {
'\\\\\((.+?)\\\\\)',
'\\[tex\\](.+?)\\[\/tex\\]'
);
$megarule = '/' . implode($rules, '|') . '/is';
$megarule = '/' . implode('|', $rules) . '/is';
preg_match_all($megarule, $text, $matches);
for ($i=0; $i<count($matches[0]); $i++) {
$texexp = '';

@ -98,7 +98,7 @@ class user_groups_editable extends \core\output\inplace_editable {
}
if (!empty($listofgroups)) {
$this->displayvalue = implode($listofgroups, ', ');
$this->displayvalue = implode(', ', $listofgroups);
} else {
$this->displayvalue = get_string('groupsnone');
}

@ -552,7 +552,7 @@ abstract class list_item {
} else {
$childrenhtml = '';
}
return $this->item_html($extraargs).'&nbsp;'.(join($this->icons, '')).(($childrenhtml !='')?("\n".$childrenhtml):'');
return $this->item_html($extraargs).'&nbsp;'.(join('', $this->icons)).(($childrenhtml !='')?("\n".$childrenhtml):'');
}
public function set_icon_html($first, $last, $lastitem) {

@ -1420,7 +1420,7 @@ function question_category_options($contexts, $top = false, $currentcat = 0,
foreach ($contexts as $context) {
$pcontexts[] = $context->id;
}
$contextslist = join($pcontexts, ', ');
$contextslist = join(', ', $pcontexts);
$categories = get_categories_for_contexts($contextslist, 'parent, sortorder, name ASC', $top);
@ -2011,7 +2011,7 @@ class question_edit_contexts {
*/
public function require_one_cap($caps) {
if (!$this->have_one_cap($caps)) {
$capsstring = join($caps, ', ');
$capsstring = join(', ', $caps);
print_error('nopermissions', '', '', $capsstring);
}
}

@ -300,7 +300,7 @@ class behat_navigation extends behat_base {
// Throw exception if no node found.
if (!$nodetoclick) {
throw new ExpectationException('Navigation node "' . $nodetext . '" not found under "' .
implode($parentnodes, ' > ') . '"', $this->getSession());
implode(' > ', $parentnodes) . '"', $this->getSession());
}
$nodetoclick->click();
}

@ -104,7 +104,7 @@ if ($getpdf) {
}
$list[] = $f;
}
$c .= implode($list, ', ');
$c .= implode(', ', $list);
$c .= '<p><i><small>Note: * Standard core fonts are not embedded in PDF files, PDF viewers are using local fonts.</small></i></p>';
$c .= '<h3>Installed languages and their alphabets</h3>';

@ -570,13 +570,13 @@ function glossary_print_recent_activity($course, $viewfullnames, $timestart) {
$joins = array(' FROM {glossary_entries} ge ');
$joins[] = 'JOIN {user} u ON u.id = ge.userid ';
$fromsql = implode($joins, "\n");
$fromsql = implode("\n", $joins);
$params['timestart'] = $timestart;
$clausesql = ' WHERE ge.timemodified > :timestart ';
if (count($approvals) > 0) {
$approvalsql = 'AND ('. implode($approvals, ' OR ') .') ';
$approvalsql = 'AND ('. implode(' OR ', $approvals) .') ';
} else {
$approvalsql = '';
}

@ -490,7 +490,7 @@ function question_build_edit_resources($edittab, $baseurl, $params) {
foreach ($contexts->having_one_edit_tab_cap($edittab) as $context){
$contextlistarr[] = "'{$context->id}'";
}
$contextlist = join($contextlistarr, ' ,');
$contextlist = join(' ,', $contextlistarr);
if (!empty($pagevars['cat'])){
$catparts = explode(',', $pagevars['cat']);
if (!$catparts[0] || (false !== array_search($catparts[1], $contextlistarr)) ||

@ -164,7 +164,7 @@ class qformat_examview extends qformat_based_on_xml {
$questions = array();
$currentquestion = array();
$text = implode($lines, ' ');
$text = implode(' ', $lines);
$text = $this->cleanunicode($text);
$xml = xmlize($text, 0);

@ -252,7 +252,7 @@ class qformat_examview_test extends question_testcase {
$lines = $this->make_test_xml();
$importer = new qformat_examview();
$text = implode($lines, ' ');
$text = implode(' ', $lines);
$xml = xmlize($text, 0);
$importer->parse_matching_groups($xml['examview']['#']['matching-group']);

@ -128,7 +128,7 @@ class user_roles_editable extends \core\output\inplace_editable {
}
if (!empty($listofroles)) {
$this->displayvalue = implode($listofroles, ', ');
$this->displayvalue = implode(', ', $listofroles);
} else if (!empty($roleids) && empty($viewableroleids)) {
$this->displayvalue = get_string('novisibleroles', 'role');
} else {