Code Duplication    Length = 11-13 lines in 2 locations

packages/connection/src/Manager.php 1 location

@@ 973-985 (lines=13) @@
970
	 * @param Array $args arguments that need to have the source added.
971
	 * @return Array $amended arguments.
972
	 */
973
	public static function apply_activation_source_to_args( $args ) {
974
		list( $activation_source_name, $activation_source_keyword ) = get_option( 'jetpack_activation_source' );
975
976
		if ( $activation_source_name ) {
977
			$args['_as'] = urlencode( $activation_source_name );
978
		}
979
980
		if ( $activation_source_keyword ) {
981
			$args['_ak'] = urlencode( $activation_source_keyword );
982
		}
983
984
		return $args;
985
	}
986
987
	/**
988
	 * Returns the callable that would be used to generate secrets.

class.jetpack.php 1 location

@@ 4619-4629 (lines=11) @@
4616
		return min( $earliest_registration_date, $earliest_post_date );
4617
	}
4618
4619
	public static function apply_activation_source_to_args( &$args ) {
4620
		list( $activation_source_name, $activation_source_keyword ) = get_option( 'jetpack_activation_source' );
4621
4622
		if ( $activation_source_name ) {
4623
			$args['_as'] = urlencode( $activation_source_name );
4624
		}
4625
4626
		if ( $activation_source_keyword ) {
4627
			$args['_ak'] = urlencode( $activation_source_keyword );
4628
		}
4629
	}
4630
4631
	function build_reconnect_url( $raw = false ) {
4632
		$url = wp_nonce_url( Jetpack::admin_url( 'action=reconnect' ), 'jetpack-reconnect' );