Code Duplication    Length = 11-13 lines in 2 locations

class.jetpack.php 1 location

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

packages/connection/src/Manager.php 1 location

@@ 1009-1021 (lines=13) @@
1006
	 * @param Array $args arguments that need to have the source added.
1007
	 * @return Array $amended arguments.
1008
	 */
1009
	public static function apply_activation_source_to_args( $args ) {
1010
		list( $activation_source_name, $activation_source_keyword ) = get_option( 'jetpack_activation_source' );
1011
1012
		if ( $activation_source_name ) {
1013
			$args['_as'] = urlencode( $activation_source_name );
1014
		}
1015
1016
		if ( $activation_source_keyword ) {
1017
			$args['_ak'] = urlencode( $activation_source_keyword );
1018
		}
1019
1020
		return $args;
1021
	}
1022
1023
	/**
1024
	 * Returns the callable that would be used to generate secrets.