| Total Complexity | 7 |
| Total Lines | 65 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class factory |
||
| 14 | { |
||
| 15 | /** @var \phpbb\language\language */ |
||
| 16 | protected $translator; |
||
| 17 | |||
| 18 | /** @var array */ |
||
| 19 | private $blocks; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Constructor |
||
| 23 | * |
||
| 24 | * @param \phpbb\language\language $translator Language object |
||
| 25 | * @param \phpbb\di\service_collection $blocks Service Collection |
||
| 26 | */ |
||
| 27 | public function __construct(\phpbb\language\language $translator, \phpbb\di\service_collection $blocks) |
||
| 28 | { |
||
| 29 | $this->translator = $translator; |
||
| 30 | 65 | ||
| 31 | $this->register_blocks($blocks); |
||
| 32 | 65 | } |
|
| 33 | 65 | ||
| 34 | /** |
||
| 35 | 65 | * Register available blocks |
|
| 36 | 65 | * @param \phpbb\di\service_collection $blocks |
|
| 37 | */ |
||
| 38 | public function register_blocks(\phpbb\di\service_collection $blocks) |
||
| 44 | 64 | } |
|
| 45 | 64 | } |
|
| 46 | |||
| 47 | 64 | /** |
|
| 48 | 64 | * Get block instance |
|
| 49 | 64 | * @param $service_name |
|
| 50 | * @return \blitze\sitemaker\services\blocks\driver\block_interface|null |
||
| 51 | */ |
||
| 52 | public function get_block($service_name) |
||
| 60 | 11 | } |
|
| 61 | |||
| 62 | /** |
||
| 63 | 39 | * Get available sitemaker blocks |
|
| 64 | 39 | * @return array |
|
| 65 | */ |
||
| 66 | 39 | public function get_all_blocks() |
|
| 80 |