Code Duplication    Length = 11-15 lines in 2 locations

class.jetpack.php 1 location

@@ 5000-5010 (lines=11) @@
4997
		return self::connection()->get_assumed_site_creation_date();
4998
	}
4999
5000
	public static function apply_activation_source_to_args( &$args ) {
5001
		list( $activation_source_name, $activation_source_keyword ) = get_option( 'jetpack_activation_source' );
5002
5003
		if ( $activation_source_name ) {
5004
			$args['_as'] = urlencode( $activation_source_name );
5005
		}
5006
5007
		if ( $activation_source_keyword ) {
5008
			$args['_ak'] = urlencode( $activation_source_keyword );
5009
		}
5010
	}
5011
5012
	function build_reconnect_url( $raw = false ) {
5013
		$url = wp_nonce_url( self::admin_url( 'action=reconnect' ), 'jetpack-reconnect' );

packages/connection/src/class-manager.php 1 location

@@ 1234-1248 (lines=15) @@
1231
	 * @param array $args arguments that need to have the source added.
1232
	 * @return array $amended arguments.
1233
	 */
1234
	public static function apply_activation_source_to_args( $args ) {
1235
		list( $activation_source_name, $activation_source_keyword ) = get_option( 'jetpack_activation_source' );
1236
1237
		if ( $activation_source_name ) {
1238
			// phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode
1239
			$args['_as'] = urlencode( $activation_source_name );
1240
		}
1241
1242
		if ( $activation_source_keyword ) {
1243
			// phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode
1244
			$args['_ak'] = urlencode( $activation_source_keyword );
1245
		}
1246
1247
		return $args;
1248
	}
1249
1250
	/**
1251
	 * Returns the callable that would be used to generate secrets.