for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace League\Plates\Template\Composer;
use League\Plates\Template;
final class ComposerRegistry
{
private $query_store;
public function __construct(Template\QueryStore $query_store) {
$this->query_store = $query_store;
}
public function add($query, callable $composer) {
$this->query_store->add($query, $composer);
public function resolve(Template $template) {
return array_merge(
...array_map(function($composer) use ($template) {
return $composer($template);
}, $this->query_store->resolve($template))
);