__call()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 14
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 14
rs 9.9666
c 0
b 0
f 0
cc 3
ccs 0
cts 12
cp 0
nc 3
nop 2
crap 12
1
<?php
2
/**
3
 * Admin Page Framework Loader
4
 * 
5
 * http://admin-page-framework.michaeluno.jp/
6
 * Copyright (c) 2013-2022, Michael Uno; Licensed GPLv2
7
 */
8
9
/**
10
 * Provides an abstract base for bases.
11
 * 
12
 * @since       3.5.3
13
 */
14
abstract class AdminPageFrameworkLoader_AdminPage_RootBase {
15
    
16
    /**
17
     * Stores callback method names.
18
     * 
19
     * @since   3.5.3
20
     */
21
    protected $aMethods = array(
22
        'replyToLoadPage',
23
        'replyToDoPage',
24
        'replyToDoAfterPage',
25
        'replyToLoadTab',
26
        'replyToDoTab',
27
        'validate',        
28
    );
29
30
    /**
31
     * Handles callback methods.
32
     * @since       3.5.3
33
     * @return      mixed
34
     */
35
    public function __call( $sMethodName, $aArguments ) {
36
        
37
        if ( in_array( $sMethodName, $this->aMethods ) ) {
38
            return isset( $aArguments[ 0 ] ) 
39
                ? $aArguments[ 0 ] 
40
                : null;
41
        }       
42
        
43
        trigger_error( 
44
            'Admin Page Framework - Loader: ' . ' : ' . sprintf( 
45
                __( 'The method is not defined: %1$s', 'admin-page-framework-loader' ),
46
                $sMethodName 
47
            ), 
48
            E_USER_WARNING 
49
        );        
50
    }
51
   
52
    /**
53
     * A user constructor.
54
     * @since       3.5.3
55
     * @return      void
56
     */
57
    protected function construct( $oFactory ) {}
0 ignored issues
show
Unused Code introduced by
The parameter $oFactory is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

57
    protected function construct( /** @scrutinizer ignore-unused */ $oFactory ) {}

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
58
    
59
}
60