Code Duplication    Length = 11-15 lines in 2 locations

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

@@ 1166-1180 (lines=15) @@
1163
	 * @param array $args arguments that need to have the source added.
1164
	 * @return array $amended arguments.
1165
	 */
1166
	public static function apply_activation_source_to_args( $args ) {
1167
		list( $activation_source_name, $activation_source_keyword ) = get_option( 'jetpack_activation_source' );
1168
1169
		if ( $activation_source_name ) {
1170
			// phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode
1171
			$args['_as'] = urlencode( $activation_source_name );
1172
		}
1173
1174
		if ( $activation_source_keyword ) {
1175
			// phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode
1176
			$args['_ak'] = urlencode( $activation_source_keyword );
1177
		}
1178
1179
		return $args;
1180
	}
1181
1182
	/**
1183
	 * Returns the callable that would be used to generate secrets.

class.jetpack.php 1 location

@@ 5059-5069 (lines=11) @@
5056
		return self::connection()->get_assumed_site_creation_date();
5057
	}
5058
5059
	public static function apply_activation_source_to_args( &$args ) {
5060
		list( $activation_source_name, $activation_source_keyword ) = get_option( 'jetpack_activation_source' );
5061
5062
		if ( $activation_source_name ) {
5063
			$args['_as'] = urlencode( $activation_source_name );
5064
		}
5065
5066
		if ( $activation_source_keyword ) {
5067
			$args['_ak'] = urlencode( $activation_source_keyword );
5068
		}
5069
	}
5070
5071
	function build_reconnect_url( $raw = false ) {
5072
		$url = wp_nonce_url( self::admin_url( 'action=reconnect' ), 'jetpack-reconnect' );