1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/11768] Updated phpbb\textformatter\s9e\factory::regenerate()

Returns an associative array rather than a numerically-indexed array. Feels
cleaner and more extensible.

PHPBB3-11768
This commit is contained in:
JoshyPHP
2015-02-15 03:08:36 +01:00
parent f6e3e41717
commit 6bd86a8e8a
6 changed files with 8 additions and 8 deletions

View File

@@ -294,7 +294,7 @@ class factory implements \phpbb\textformatter\cache
/**
* Regenerate and cache a new parser and renderer
*
* @return array Array with two elements: an instance of the parser, an instance of the renderer
* @return array Associative array with at least two elements: "parser" and "renderer"
*/
public function regenerate()
{
@@ -315,7 +315,7 @@ class factory implements \phpbb\textformatter\cache
);
$this->cache->put($this->cache_key_renderer, $renderer_data);
return array($parser, $renderer);
return array('parser' => $parser, 'renderer' => $renderer);
}
/**

View File

@@ -48,7 +48,7 @@ class parser extends \phpbb\textformatter\parser
$parser = $cache->get($key);
if (!$parser)
{
list($parser) = $factory->regenerate();
extract($factory->regenerate());
}
$this->parser = $parser;

View File

@@ -80,7 +80,7 @@ class renderer extends \phpbb\textformatter\renderer
if (!isset($renderer))
{
list(, $renderer) = $factory->regenerate();
extract($factory->regenerate());
}
$this->renderer = $renderer;