diff --git a/phpBB/phpbb/event/md_exporter.php b/phpBB/phpbb/event/md_exporter.php index 4940094e77..540ec9a0d7 100644 --- a/phpBB/phpbb/event/md_exporter.php +++ b/phpBB/phpbb/event/md_exporter.php @@ -40,6 +40,11 @@ class md_exporter $this->filter = $this->current_event = ''; } + /** + * Get the list of all events + * + * @return array Array with events: name => details + */ public function get_events() { return $this->events; @@ -47,7 +52,6 @@ class md_exporter /** * @param string $md_file - * @param string $filter * @return int Number of events found * @throws \LogicException */ @@ -67,7 +71,6 @@ class md_exporter /** * @param string $md_file - * @param string $filter * @return int Number of events found * @throws \LogicException */ @@ -279,6 +282,13 @@ class md_exporter return $files_list; } + /** + * Get all template events in a template file + * + * @param string $file + * @return array + * @throws \LogicException + */ public function crawl_file_for_events($file) { if (!file_exists($this->root_path . $file)) @@ -294,8 +304,8 @@ class md_exporter array_shift($events); foreach ($events as $event) { - list($event_name, $null) = explode(' -->', $event, 2); - $event_list[] = $event_name; + $event = explode(' -->', $event, 2); + $event_list[] = array_shift($event); } return $event_list; @@ -306,7 +316,7 @@ class md_exporter * * @param string $file * @param array $events - * @return null + * @return true * @throws \LogicException */ public function validate_events_from_file($file, array $events) diff --git a/phpBB/phpbb/event/php_exporter.php b/phpBB/phpbb/event/php_exporter.php index a92bd2671d..41058216e8 100644 --- a/phpBB/phpbb/event/php_exporter.php +++ b/phpBB/phpbb/event/php_exporter.php @@ -46,17 +46,35 @@ class php_exporter $this->current_event_line = 0; } + /** + * Get the list of all events + * + * @return array Array with events: name => details + */ public function get_events() { return $this->events; } + /** + * Set current event data + * + * @param string $name Name of the current event (used for error messages) + * @param int $line Line where the current event is placed in + * @return null + */ public function set_current_event($name, $line) { $this->current_event = $name; $this->current_event_line = $line; } + /** + * Set the content of this file + * + * @param array $content Array with the lines of the file + * @return null + */ public function set_content($content) { $this->file_lines = $content; @@ -322,6 +340,8 @@ class php_exporter * Find the variables in single line array * * @param string $line + * @param bool $throw_multiline Throw an exception when there are too + * many arguments in one line. * @return array List of variables * @throws \LogicException */ @@ -349,7 +369,6 @@ class php_exporter /** * Find the variables in single line array * - * @param string $line * @return array List of variables * @throws \LogicException */