Completed
Pull Request — master (#5)
by mw
01:35
created

CallbackContainerFactory   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 3
dl 0
loc 39
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A newCallbackContainerBuilder() 0 3 1
A newNullContainerBuilder() 0 3 1
A newServicesManager() 0 8 2
1
<?php
2
3
namespace Onoi\CallbackContainer;
4
5
/**
6
 * @license GNU GPL v2+
7
 * @since 2.0
8
 *
9
 * @author mwjames
10
 */
11
class CallbackContainerFactory {
12
13
	/**
14
	 * @since 2.0
15
	 *
16
	 * @param CallbackContainer|null $callbackContainer
17
	 *
18
	 * @return CallbackContainerBuilder
19
	 */
20 2
	public function newCallbackContainerBuilder( CallbackContainer $callbackContainer = null ) {
21 2
		return new CallbackContainerBuilder( $callbackContainer );
22
	}
23
24
	/**
25
	 * @since 2.0
26
	 *
27
	 * @return NullContainerBuilder
28
	 */
29 1
	public function newNullContainerBuilder() {
30 1
		return new NullContainerBuilder();
31
	}
32
33
	/**
34
	 * @since 2.0
35
	 *
36
	 * @param ContainerBuilder|null $callbackContainer
0 ignored issues
show
Bug introduced by
There is no parameter named $callbackContainer. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
37
	 *
38
	 * @return ServicesManager
39
	 */
40 1
	public function newServicesManager( ContainerBuilder $containerBuilder = null ) {
41
42 1
		if ( $containerBuilder === null ) {
43 1
			$containerBuilder = $this->newCallbackContainerBuilder();
44 1
		}
45
46 1
		return new ServicesManager( $containerBuilder );
47
	}
48
49
}
50