Completed
Push — update/sync-remove-references-... ( 70b2fb...317b35 )
by
unknown
74:02 queued 64:08
created

plugin.php ➔ test_sync_changes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
1
<?php
2
/**
3
 * Jetpack Sync Tester
4
 *
5
 * Sync PR #18608 Tester.
6
 *
7
 * @link       https://jetpack.com/
8
 *
9
 * @package    Jetpack
10
 * @subpackage Sync
11
 * @since      9.6
12
 */
13
14
/**
15
 * Plugin Name: Sync PR #18608 Tester.
16
 */
17
18
require_once plugin_dir_path( __FILE__ ) . '/vendor/autoload_packages.php';
19
20
/**
21
 * Test Sync changes.
22
 */
23
function test_sync_changes() {
24
	// Test change to Functions::get_modules().
25
	error_log( 'get_modules returns: ' . print_r( Automattic\Jetpack\Sync\Functions::get_modules(), true ) );
26
27
	// Test change to Listener::get_actor(). The returned array should include the actor's ip.
28
	error_log( 'get_actor returns ' . print_r( Automattic\Jetpack\Sync\Listener::get_instance()->get_actor( 'jetpack_wp_login', null ), true ) );
0 ignored issues
show
Documentation introduced by
null is of type null, but the function expects a object.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
29
30
	// Test change to Options::jetpack_sync_core_icon().
31
	error_log( 'calling jetpack_sync_core_icon' );
32
	( new Automattic\Jetpack\Sync\Modules\Options() )->jetpack_sync_core_icon();
33
}
34
35
add_action( 'plugins_loaded', 'test_sync_changes' );
36