ServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
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 38
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 10 1
A add_assets() 0 3 1
1
<?php
2
namespace Intraxia\Jaxion\Assets;
3
4
use Intraxia\Jaxion\Contract\Core\Container;
5
use Intraxia\Jaxion\Contract\Core\ServiceProvider as ServiceProviderContract;
6
7
/**
8
 * Class AssetsServiceProvider
9
 *
10
 * @package Intraxia\Jaxion
11
 * @subpackage Assets
12
 */
13
class ServiceProvider implements ServiceProviderContract {
14
	/**
15
	 * Container to register with.
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
		$container->define(
30 3
			array( 'assets' => 'Intraxia\Jaxion\Contract\Assets\Register' ),
31 3
			$register = new Register( $container->fetch( 'url' ), $container->fetch( 'version' ) )
32 2
		);
33
34 3
		$this->add_assets( $register );
35 3
	}
36
37
	/**
38
	 * Registers the assets on the generated Register.
39
	 *
40
	 * This is a no-op by default by can be overwritten by the implementing developer
41
	 * to provide a single, clean location to register their assets.
42
	 *
43
	 * @param Register $register
44
	 *
45
	 * @codeCoverageIgnore
46
	 */
47
	protected function add_assets( Register $register ) {
0 ignored issues
show
Unused Code introduced by
The parameter $register 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...
48
		// no-op
49
	}
50
}
51