RequestsServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 14
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A bootstrap() 0 1 1
A register() 0 3 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\Requests;
11
12
use WPEmerge\ServiceProviders\ServiceProviderInterface;
13
14
/**
15
 * Provide request dependencies.
16
 *
17
 * @codeCoverageIgnore
18
 */
19
class RequestsServiceProvider implements ServiceProviderInterface {
20
	/**
21
	 * {@inheritDoc}
22
	 */
23
	public function register( $container ) {
24
		$container[ WPEMERGE_REQUEST_KEY ] = function () {
25
			return Request::fromGlobals();
26
		};
27
	}
28
29
	/**
30
	 * {@inheritDoc}
31
	 */
32
	public function bootstrap( $container ) {
33
		// Nothing to bootstrap.
34
	}
35
}
36