Line 161 | Line 161 |
---|
* * @param string $action * @return string
|
* * @param string $action * @return string
|
| * @deprecated 3.3.5-RC1 (To be removed: 4.0.0-a1)
|
*/ public function export_events_for_wiki($action = '') {
| */ public function export_events_for_wiki($action = '') {
|
Line 182 | Line 183 |
---|
$wiki_page .= '|}' . "\n";
return $wiki_page;
|
$wiki_page .= '|}' . "\n";
return $wiki_page;
|
| }
/** * Format the PHP events as a rst table * * @param string $action * @return string */ public function export_events_for_rst(string $action = ''): string { $rst_exporter = new rst_exporter(); $rst_exporter->add_section_header($action === 'diff' ? 'h3' : 'h2', 'PHP Events'); $rst_exporter->set_columns([ 'event' => 'Identifier', 'file' => 'Placement', 'arguments' => 'Arguments', 'since' => 'Added in Release', 'description' => 'Explanation', ]); $rst_exporter->generate_events_table($this->events);
return $rst_exporter->get_rst_output(); }
/** * Format the PHP events as a BBCode list * * @param string $action * @return string */ public function export_events_for_bbcode(string $action = ''): string { if ($action === 'diff') { $bbcode_text = '[size=150]PHP Events[/size]' . "\n"; } else { $bbcode_text = '[size=200]PHP Events[/size]' . "\n"; }
foreach ($this->events as $event) { $bbcode_text .= "[list]\n"; $bbcode_text .= "[*][b]{$event['event']}[/b]\n"; $bbcode_text .= "Placement: {$event['file']}\n"; $bbcode_text .= 'Arguments: ' . implode(', ', $event['arguments']) . "\n"; $bbcode_text .= "Added in Release: {$event['since']}\n"; $bbcode_text .= "Explanation: {$event['description']}\n"; $bbcode_text .= "[/list]\n"; }
return $bbcode_text;
|
}
/**
| }
/**
|
Line 287 | Line 341 |
---|
array_pop($description_lines); }
|
array_pop($description_lines); }
|
$description = trim(implode('<br/>', $description_lines));
| $description = trim(implode('<br>', $description_lines)); sort($arguments);
|
if (isset($this->events[$this->current_event]))
|
if (isset($this->events[$this->current_event]))
|
| { if ($this->events[$this->current_event]['arguments'] != $arguments || $this->events[$this->current_event]['since'] != $since)
|
{ throw new \LogicException("The event '{$this->current_event}' from file " . "'{$this->current_file}:{$event_line_num}' already exists in file " . "'{$this->events[$this->current_event]['file']}'", 10); }
|
{ throw new \LogicException("The event '{$this->current_event}' from file " . "'{$this->current_file}:{$event_line_num}' already exists in file " . "'{$this->events[$this->current_event]['file']}'", 10); }
|
sort($arguments);
| $this->events[$this->current_event]['file'] .= '<br>' . $this->current_file; } else {
|
$this->events[$this->current_event] = array(
|
$this->events[$this->current_event] = array(
|
'event' => $this->current_event, 'file' => $this->current_file, 'arguments' => $arguments, 'since' => $since, 'description' => $description,
| 'event' => $this->current_event, 'file' => $this->current_file, 'arguments' => $arguments, 'since' => $since, 'description' => $description,
|
); $num_events_found++;
|
); $num_events_found++;
|
| }
|
} } }
| } } }
|