Completed
Push — add/anchor-fm-badge-insertion ( 367060...0b7190 )
by
unknown
180:57 queued 171:53
created

Test_Container::replace()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Class file for container to be used in tests to override dependencies.
4
 *
5
 * @package automattic/jetpack-autoloader
6
 */
7
8
/**
9
 * Class Test_Container
10
 */
11
class Test_Container extends Container {
12
13
	/**
14
	 * Replaces a dependency in the container.
15
	 *
16
	 * @param string $class_name The class name to replace.
17
	 * @param mixed  $instance The instance to replace.
18
	 */
19
	public function replace( $class_name, $instance ) {
20
		$this->dependencies[ $class_name ] = $instance;
21
	}
22
}
23