ServiceProvider::add_routes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
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