Code Duplication    Length = 11-13 lines in 2 locations

packages/connection/src/Manager.php 1 location

@@ 844-856 (lines=13) @@
841
	 * @param Array $args arguments that need to have the source added.
842
	 * @return Array $amended arguments.
843
	 */
844
	public static function apply_activation_source_to_args( $args ) {
845
		list( $activation_source_name, $activation_source_keyword ) = get_option( 'jetpack_activation_source' );
846
847
		if ( $activation_source_name ) {
848
			$args['_as'] = urlencode( $activation_source_name );
849
		}
850
851
		if ( $activation_source_keyword ) {
852
			$args['_ak'] = urlencode( $activation_source_keyword );
853
		}
854
855
		return $args;
856
	}
857
858
	/**
859
	 * Returns the callable that would be used to generate secrets.

class.jetpack.php 1 location

@@ 4478-4488 (lines=11) @@
4475
		return min( $earliest_registration_date, $earliest_post_date );
4476
	}
4477
4478
	public static function apply_activation_source_to_args( &$args ) {
4479
		list( $activation_source_name, $activation_source_keyword ) = get_option( 'jetpack_activation_source' );
4480
4481
		if ( $activation_source_name ) {
4482
			$args['_as'] = urlencode( $activation_source_name );
4483
		}
4484
4485
		if ( $activation_source_keyword ) {
4486
			$args['_ak'] = urlencode( $activation_source_keyword );
4487
		}
4488
	}
4489
4490
	function build_reconnect_url( $raw = false ) {
4491
		$url = wp_nonce_url( Jetpack::admin_url( 'action=reconnect' ), 'jetpack-reconnect' );