Passed
Push — master ( 517cb3...2c2725 )
by Atanas
02:15
created

OldInputServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 14 1
A boot() 0 3 1
1
<?php
2
3
namespace WPEmerge\Input;
4
5
use WPEmerge;
6
use WPEmerge\ServiceProviders\ServiceProviderInterface;
7
8
/**
9
 * Provide old input dependencies
10
 *
11
 * @codeCoverageIgnore
12
 */
13
class OldInputServiceProvider implements ServiceProviderInterface {
14
	/**
15
	 * {@inheritDoc}
16
	 */
17
	public function register( $container ) {
18
		$container[ WP_EMERGE_ROUTING_GLOBAL_MIDDLEWARE_KEY ] = array_merge(
19
			$container[ WP_EMERGE_ROUTING_GLOBAL_MIDDLEWARE_KEY ],
20
			[
21
				\WPEmerge\Input\OldInputMiddleware::class,
22
			]
23
		);
24
25
		$container[ WP_EMERGE_OLD_INPUT_KEY ] = function() {
26
			return new \WPEmerge\Input\OldInput();
27
		};
28
29
		WPEmerge::facade( 'OldInput', \WPEmerge\Input\OldInputFacade::class );
30
	}
31
32
	/**
33
	 * {@inheritDoc}
34
	 */
35
	public function boot( $container ) {
36
		// nothing to boot
37
	}
38
}
39