Code Duplication    Length = 11-13 lines in 2 locations

class.jetpack.php 1 location

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

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.