Code Duplication    Length = 11-13 lines in 2 locations

class.jetpack.php 1 location

@@ 4642-4652 (lines=11) @@
4639
		return min( $earliest_registration_date, $earliest_post_date );
4640
	}
4641
4642
	public static function apply_activation_source_to_args( &$args ) {
4643
		list( $activation_source_name, $activation_source_keyword ) = get_option( 'jetpack_activation_source' );
4644
4645
		if ( $activation_source_name ) {
4646
			$args['_as'] = urlencode( $activation_source_name );
4647
		}
4648
4649
		if ( $activation_source_keyword ) {
4650
			$args['_ak'] = urlencode( $activation_source_keyword );
4651
		}
4652
	}
4653
4654
	function build_reconnect_url( $raw = false ) {
4655
		$url = wp_nonce_url( Jetpack::admin_url( 'action=reconnect' ), 'jetpack-reconnect' );

packages/connection/src/Manager.php 1 location

@@ 994-1006 (lines=13) @@
991
	 * @param Array $args arguments that need to have the source added.
992
	 * @return Array $amended arguments.
993
	 */
994
	public static function apply_activation_source_to_args( $args ) {
995
		list( $activation_source_name, $activation_source_keyword ) = get_option( 'jetpack_activation_source' );
996
997
		if ( $activation_source_name ) {
998
			$args['_as'] = urlencode( $activation_source_name );
999
		}
1000
1001
		if ( $activation_source_keyword ) {
1002
			$args['_ak'] = urlencode( $activation_source_keyword );
1003
		}
1004
1005
		return $args;
1006
	}
1007
1008
	/**
1009
	 * Returns the callable that would be used to generate secrets.