PluginProbe
MONEI Payments for WooCommerce / trunk
MONEI Payments for WooCommerce vtrunk
7.3.3 7.3.2 7.3.1 7.3.0 7.2.4 7.2.3 7.2.2 7.2.0 7.2.1 7.1.3 2.1.0 3.0.0 3.1.0 3.1.1 4.0.0 4.1.0 4.1.1 4.2.0 4.2.1 5.0 5.1.0 5.1.1 5.1.2 5.2.2 5.2.3 All 87 releases
monei / src / Templates / TemplateManager.php

TemplateManager.php in MONEI Payments for WooCommerce trunk, at src/Templates/TemplateManager.php

29 lines 582 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Monei\Templates;
4
5 class TemplateManager {
6
7 /**
8 * @var TemplateInterface[]
9 */
10 private array $templates = array();
11
12 /**
13 * @param TemplateInterface[] $templates Keyed array of templateName => TemplateInstance
14 */
15 public function __construct( array $templates ) {
16 $this->templates = $templates;
17 }
18
19 /**
20 * Retrieve the template instance by name.
21 *
22 * @param string $templateName
23 * @return TemplateInterface|null
24 */
25 public function getTemplate( string $templateName ): ?TemplateInterface {
26 return $this->templates[ $templateName ] ?? null;
27 }
28 }
29