OldInputServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 11 1
A bootstrap() 0 1 1
1
<?php
2
/**
3
 * @package   WPEmerge
4
 * @author    Atanas Angelov <[email protected]>
5
 * @copyright 2017-2019 Atanas Angelov
6
 * @license   https://www.gnu.org/licenses/gpl-2.0.html GPL-2.0
7
 * @link      https://wpemerge.com/
8
 */
9
10
namespace WPEmerge\Input;
11
12
use WPEmerge\ServiceProviders\ServiceProviderInterface;
13
14
/**
15
 * Provide old input dependencies.
16
 *
17
 * @codeCoverageIgnore
18
 */
19
class OldInputServiceProvider implements ServiceProviderInterface {
20
	/**
21
	 * {@inheritDoc}
22
	 */
23
	public function register( $container ) {
24
		$container[ WPEMERGE_OLD_INPUT_KEY ] = function ( $c ) {
25
			return new OldInput( $c[ WPEMERGE_FLASH_KEY ] );
26
		};
27
28
		$container[ OldInputMiddleware::class ] = function ( $c ) {
29
			return new OldInputMiddleware( $c[ WPEMERGE_OLD_INPUT_KEY ] );
30
		};
31
32
		$app = $container[ WPEMERGE_APPLICATION_KEY ];
33
		$app->alias( 'oldInput', WPEMERGE_OLD_INPUT_KEY );
34
	}
35
36
	/**
37
	 * {@inheritDoc}
38
	 */
39
	public function bootstrap( $container ) {
40
		// Nothing to bootstrap.
41
	}
42
}
43