Code Duplication    Length = 9-19 lines in 2 locations

class.jetpack.php 2 locations

@@ 865-883 (lines=19) @@
862
	 * @param Boolean               $is_signed      Whether the signature check has been successful.
863
	 * @param Jetpack_XMLRPC_Server $xmlrpc_server  (optional) An instance of the server to use instead of instantiating a new one.
864
	 */
865
	public function setup_xmlrpc_handlers(
866
		$request_params,
867
		$is_active,
868
		$is_signed,
869
		Jetpack_XMLRPC_Server $xmlrpc_server = null
870
	) {
871
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::setup_xmlrpc_handlers' );
872
873
		if ( ! $this->connection_manager ) {
874
			$this->connection_manager = new Connection_Manager();
875
		}
876
877
		return $this->connection_manager->setup_xmlrpc_handlers(
878
			$request_params,
879
			$is_active,
880
			$is_signed,
881
			$xmlrpc_server
882
		);
883
	}
884
885
	/**
886
	 * Initialize REST API registration connector.
@@ 5680-5688 (lines=9) @@
5677
	 * @param string         $password Password string.
5678
	 * @return \WP_User|mixed Authenticated user or error.
5679
	 */
5680
	public function authenticate_jetpack( $user, $username, $password ) {
5681
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::authenticate_jetpack' );
5682
5683
		if ( ! $this->connection_manager ) {
5684
			$this->connection_manager = new Connection_Manager();
5685
		}
5686
5687
		return $this->connection_manager->authenticate_jetpack( $user, $username, $password );
5688
	}
5689
5690
	// Authenticates requests from Jetpack server to WP REST API endpoints.
5691
	// Uses the existing XMLRPC request signing implementation.