Code Duplication    Length = 11-15 lines in 2 locations

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

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

class.jetpack.php 1 location

@@ 4974-4984 (lines=11) @@
4971
		return self::connection()->get_assumed_site_creation_date();
4972
	}
4973
4974
	public static function apply_activation_source_to_args( &$args ) {
4975
		list( $activation_source_name, $activation_source_keyword ) = get_option( 'jetpack_activation_source' );
4976
4977
		if ( $activation_source_name ) {
4978
			$args['_as'] = urlencode( $activation_source_name );
4979
		}
4980
4981
		if ( $activation_source_keyword ) {
4982
			$args['_ak'] = urlencode( $activation_source_keyword );
4983
		}
4984
	}
4985
4986
	function build_reconnect_url( $raw = false ) {
4987
		$url = wp_nonce_url( self::admin_url( 'action=reconnect' ), 'jetpack-reconnect' );