1 | <?php |
||
16 | class Abtest { |
||
17 | /** |
||
18 | * A variable to hold the tests we fetched, and their variations for the current user. |
||
19 | * |
||
20 | * @access private |
||
21 | * |
||
22 | * @var array |
||
23 | */ |
||
24 | private $tests = array(); |
||
25 | |||
26 | /** |
||
27 | * Retrieve the test variation for a provided A/B test. |
||
28 | * |
||
29 | * @access public |
||
30 | * |
||
31 | * @param string $test_name Name of the A/B test. |
||
32 | * @return mixed|null A/B test variation, or null on failure. |
||
33 | */ |
||
34 | public function get_variation( $test_name ) { |
||
44 | |||
45 | /** |
||
46 | * Fetch and cache the test variation for a provided A/B test from WP.com. |
||
47 | * |
||
48 | * @access protected |
||
49 | * |
||
50 | * @param string $test_name Name of the A/B test. |
||
51 | * @return mixed|Automattic\Jetpack\Error A/B test variation, or Automattic\Jetpack\Error on failure. |
||
52 | */ |
||
53 | protected function fetch_variation( $test_name ) { |
||
90 | |||
91 | /** |
||
92 | * Perform the request for a variation of a provided A/B test from WP.com. |
||
93 | * |
||
94 | * @access protected |
||
95 | * |
||
96 | * @param string $test_name Name of the A/B test. |
||
97 | * @return mixed|Automattic\Jetpack\Error A/B test variation, or Automattic\Jetpack\Error on failure. |
||
98 | */ |
||
99 | protected function request_variation( $test_name ) { |
||
102 | } |
||
103 |
This check compares calls to functions or methods with their respective definitions. If the call has more 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.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.