Code Duplication    Length = 9-19 lines in 2 locations

class.jetpack.php 2 locations

@@ 857-875 (lines=19) @@
854
	 * @param Boolean               $is_signed      Whether the signature check has been successful.
855
	 * @param Jetpack_XMLRPC_Server $xmlrpc_server  (optional) An instance of the server to use instead of instantiating a new one.
856
	 */
857
	public function setup_xmlrpc_handlers(
858
		$request_params,
859
		$is_active,
860
		$is_signed,
861
		Jetpack_XMLRPC_Server $xmlrpc_server = null
862
	) {
863
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::setup_xmlrpc_handlers' );
864
865
		if ( ! $this->connection_manager ) {
866
			$this->connection_manager = new Connection_Manager();
867
		}
868
869
		return $this->connection_manager->setup_xmlrpc_handlers(
870
			$request_params,
871
			$is_active,
872
			$is_signed,
873
			$xmlrpc_server
874
		);
875
	}
876
877
	/**
878
	 * Initialize REST API registration connector.
@@ 5505-5513 (lines=9) @@
5502
	 * @param string         $password Password string.
5503
	 * @return \WP_User|mixed Authenticated user or error.
5504
	 */
5505
	public function authenticate_jetpack( $user, $username, $password ) {
5506
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::authenticate_jetpack' );
5507
5508
		if ( ! $this->connection_manager ) {
5509
			$this->connection_manager = new Connection_Manager();
5510
		}
5511
5512
		return $this->connection_manager->authenticate_jetpack( $user, $username, $password );
5513
	}
5514
5515
	// Authenticates requests from Jetpack server to WP REST API endpoints.
5516
	// Uses the existing XMLRPC request signing implementation.