Code Duplication    Length = 11-13 lines in 2 locations

class.jetpack.php 1 location

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

packages/connection/src/Manager.php 1 location

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