TestHelper   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 11
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A bootstrap() 0 7 1
A getAimeos() 0 11 2
1
<?php
2
3
4
/**
5
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
6
 * @copyright Aimeos (aimeos.org), 2015-2024
7
 */
8
class TestHelper
9
{
10
	private static $aimeos;
11
12
13
	public static function bootstrap()
14
	{
15
		$aimeos = self::getAimeos();
16
17
		$includepaths = $aimeos->getIncludePaths();
18
		$includepaths[] = get_include_path();
19
		set_include_path( implode( PATH_SEPARATOR, $includepaths ) );
20
	}
21
22
23
	public static function getAimeos()
24
	{
25
		if( !isset( self::$aimeos ) )
26
		{
27
			require_once 'Bootstrap.php';
28
			spl_autoload_register( 'Aimeos\\Bootstrap::autoload' );
29
30
			self::$aimeos = new \Aimeos\Bootstrap();
31
		}
32
33
		return self::$aimeos;
34
	}
35
}
36