ServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 35
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 7 1
A add_routes() 0 3 1
1
<?php
2
namespace Intraxia\Jaxion\Http;
3
4
use Intraxia\Jaxion\Contract\Core\Container;
5
use Intraxia\Jaxion\Contract\Core\ServiceProvider as ServiceProviderContract;
6
7
/**
8
 * Class RouterServiceProvider
9
 *
10
 * @package Intraxia\Jaxion
11
 * @subpackage Http
12
 */
13
class ServiceProvider implements ServiceProviderContract {
14
	/**
15
	 * Container to register on.
16
	 *
17
	 * @var Container
18
	 */
19
	protected $container;
20
21
	/**
22
	 * {@inheritDoc}
23
	 *
24
	 * @param Container $container
25
	 */
26 3
	public function register( Container $container ) {
27 3
		$this->container = $container;
28
29 3
		$this->container->define( array( 'router' => 'Intraxia\Jaxion\Http\Router' ), $router = new Router );
30
31 3
		$this->add_routes( $router );
32 3
	}
33
34
	/**
35
	 * Registers the routes on the generated Router.
36
	 *
37
	 * This is a no-op by default by can be overwritten by the implementing developer
38
	 * to provide a single, clean location to register their routes.
39
	 *
40
	 * @param Router $router
41
	 *
42
	 * @codeCoverageIgnore
43
	 */
44
	protected function add_routes( Router $router ) {
0 ignored issues
show
Unused Code introduced by
The parameter $router is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
45
		// no-op
46
	}
47
}
48