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

newCallbackContainerBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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