Passed
Push — master ( 7dac2b...30127e )
by Atanas
01:55
created

ViewServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 1
rs 10
1
<?php
2
3
namespace WPEmerge\View;
4
5
use WPEmerge;
6
use WPEmerge\ServiceProviders\ServiceProviderInterface;
7
8
/**
9
 * Provide view dependencies
10
 *
11
 * @codeCoverageIgnore
12
 */
13
class ViewServiceProvider implements ServiceProviderInterface {
14
	/**
15
	 * {@inheritDoc}
16
	 */
17
	public function register( $container ) {
18
		$container[ WPEMERGE_CONFIG_KEY ] = array_merge( [
19
			'global_view_context' => [],
20
		], $container[ WPEMERGE_CONFIG_KEY ] );
21
22
		$container[ WPEMERGE_VIEW_ENGINE_PHP_KEY ] = function( $c ) {
23
			return new \WPEmerge\View\Php( $c[ WPEMERGE_CONFIG_KEY ]['global_view_context'] );
24
		};
25
26
		$container[ WPEMERGE_VIEW_ENGINE_KEY ] = $container->raw( WPEMERGE_VIEW_ENGINE_PHP_KEY );
27
	}
28
29
	/**
30
	 * {@inheritDoc}
31
	 */
32
	public function boot( $container ) {
33
		// nothing to boot
34
	}
35
}
36