1 | <?php |
||
8 | class TestHelper |
||
9 | { |
||
10 | private static $aimeos; |
||
11 | private static $context = []; |
||
12 | |||
13 | |||
14 | public static function bootstrap() |
||
21 | } |
||
22 | |||
23 | |||
24 | public static function getContext( $site = 'unittest' ) |
||
25 | { |
||
26 | if( !isset( self::$context[$site] ) ) { |
||
27 | self::$context[$site] = self::createContext( $site ); |
||
28 | } |
||
29 | |||
30 | return clone self::$context[$site]; |
||
31 | } |
||
32 | |||
33 | |||
34 | private static function getAimeos() |
||
35 | { |
||
36 | if( !isset( self::$aimeos ) ) |
||
37 | { |
||
38 | require_once 'Bootstrap.php'; |
||
39 | spl_autoload_register( 'Aimeos\\Bootstrap::autoload' ); |
||
40 | |||
41 | $extdir = dirname( dirname( dirname( __DIR__ ) ) ); |
||
42 | self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), false ); |
||
43 | } |
||
44 | |||
45 | return self::$aimeos; |
||
46 | } |
||
47 | |||
48 | |||
49 | /** |
||
50 | * @param string $site |
||
51 | */ |
||
52 | private static function createContext( $site ) |
||
85 | } |
||
86 | } |
||
87 |
This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.