Completed
Push — renovate/mocha-6.x ( f901fe...f3dd78 )
by
unknown
56:50 queued 50:25
created

packages/compat/lib/tracks/client.php (2 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/**
4
 * @deprecated 7.5.0 use Automattic\Jetpack\Tracking->tracks_get_identity instead
5
 */
6
function jetpack_tracks_get_identity( $user_id ) {
7
	_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Tracking->tracks_get_identity' );
8
9
	$tracking = new Automattic\Jetpack\Tracking( 'jetpack', Jetpack::connection() );
0 ignored issues
show
\Jetpack::connection() is of type object<Automattic\Jetpack\Connection\Manager>, but the function expects a object<Automattic\Jetpac...onnection\Manager>|null.

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...
10
	return $tracking->tracks_get_identity( $user_id );
11
}
12
13
/**
14
 * @deprecated 7.5.0 use Automattic\Jetpack\Tracking->tracks_record_event instead
15
 */
16
function jetpack_tracks_record_event( $user, $event_name, $properties = array(), $event_timestamp_millis = false ) {
17
	_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Tracking->tracks_record_event' );
18
19
	$tracking = new Automattic\Jetpack\Tracking( 'jetpack', Jetpack::connection() );
0 ignored issues
show
\Jetpack::connection() is of type object<Automattic\Jetpack\Connection\Manager>, but the function expects a object<Automattic\Jetpac...onnection\Manager>|null.

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...
20
	return $tracking->tracks_record_event( $user, $event_name, $properties, $event_timestamp_millis );
21
}
22