[ticket/12273] Fix doc blocks

PHPBB3-12273
This commit is contained in:
Joas Schilling 2014-04-26 16:30:19 +02:00
parent 18be18e998
commit 6aa8596d4d
2 changed files with 35 additions and 6 deletions

View file

@ -40,6 +40,11 @@ class md_exporter
$this->filter = $this->current_event = ''; $this->filter = $this->current_event = '';
} }
/**
* Get the list of all events
*
* @return array Array with events: name => details
*/
public function get_events() public function get_events()
{ {
return $this->events; return $this->events;
@ -47,7 +52,6 @@ class md_exporter
/** /**
* @param string $md_file * @param string $md_file
* @param string $filter
* @return int Number of events found * @return int Number of events found
* @throws \LogicException * @throws \LogicException
*/ */
@ -67,7 +71,6 @@ class md_exporter
/** /**
* @param string $md_file * @param string $md_file
* @param string $filter
* @return int Number of events found * @return int Number of events found
* @throws \LogicException * @throws \LogicException
*/ */
@ -279,6 +282,13 @@ class md_exporter
return $files_list; 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) public function crawl_file_for_events($file)
{ {
if (!file_exists($this->root_path . $file)) if (!file_exists($this->root_path . $file))
@ -294,8 +304,8 @@ class md_exporter
array_shift($events); array_shift($events);
foreach ($events as $event) foreach ($events as $event)
{ {
list($event_name, $null) = explode(' -->', $event, 2); $event = explode(' -->', $event, 2);
$event_list[] = $event_name; $event_list[] = array_shift($event);
} }
return $event_list; return $event_list;
@ -306,7 +316,7 @@ class md_exporter
* *
* @param string $file * @param string $file
* @param array $events * @param array $events
* @return null * @return true
* @throws \LogicException * @throws \LogicException
*/ */
public function validate_events_from_file($file, array $events) public function validate_events_from_file($file, array $events)

View file

@ -46,17 +46,35 @@ class php_exporter
$this->current_event_line = 0; $this->current_event_line = 0;
} }
/**
* Get the list of all events
*
* @return array Array with events: name => details
*/
public function get_events() public function get_events()
{ {
return $this->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) public function set_current_event($name, $line)
{ {
$this->current_event = $name; $this->current_event = $name;
$this->current_event_line = $line; $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) public function set_content($content)
{ {
$this->file_lines = $content; $this->file_lines = $content;
@ -322,6 +340,8 @@ class php_exporter
* Find the variables in single line array * Find the variables in single line array
* *
* @param string $line * @param string $line
* @param bool $throw_multiline Throw an exception when there are too
* many arguments in one line.
* @return array List of variables * @return array List of variables
* @throws \LogicException * @throws \LogicException
*/ */
@ -349,7 +369,6 @@ class php_exporter
/** /**
* Find the variables in single line array * Find the variables in single line array
* *
* @param string $line
* @return array List of variables * @return array List of variables
* @throws \LogicException * @throws \LogicException
*/ */