Code Duplication    Length = 11-15 lines in 2 locations

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

@@ 1098-1112 (lines=15) @@
1095
	 * @param Array $args arguments that need to have the source added.
1096
	 * @return Array $amended arguments.
1097
	 */
1098
	public static function apply_activation_source_to_args( $args ) {
1099
		list( $activation_source_name, $activation_source_keyword ) = get_option( 'jetpack_activation_source' );
1100
1101
		if ( $activation_source_name ) {
1102
			// phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode
1103
			$args['_as'] = urlencode( $activation_source_name );
1104
		}
1105
1106
		if ( $activation_source_keyword ) {
1107
			// phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode
1108
			$args['_ak'] = urlencode( $activation_source_keyword );
1109
		}
1110
1111
		return $args;
1112
	}
1113
1114
	/**
1115
	 * Returns the callable that would be used to generate secrets.

class.jetpack.php 1 location

@@ 4801-4811 (lines=11) @@
4798
		return self::connection()->get_assumed_site_creation_date();
4799
	}
4800
4801
	public static function apply_activation_source_to_args( &$args ) {
4802
		list( $activation_source_name, $activation_source_keyword ) = get_option( 'jetpack_activation_source' );
4803
4804
		if ( $activation_source_name ) {
4805
			$args['_as'] = urlencode( $activation_source_name );
4806
		}
4807
4808
		if ( $activation_source_keyword ) {
4809
			$args['_ak'] = urlencode( $activation_source_keyword );
4810
		}
4811
	}
4812
4813
	function build_reconnect_url( $raw = false ) {
4814
		$url = wp_nonce_url( self::admin_url( 'action=reconnect' ), 'jetpack-reconnect' );