Code Duplication    Length = 11-13 lines in 2 locations

class.jetpack.php 1 location

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

packages/connection/src/Manager.php 1 location

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