Code Duplication    Length = 9-19 lines in 2 locations

class.jetpack.php 2 locations

@@ 863-881 (lines=19) @@
860
	 * @param Boolean               $is_signed      Whether the signature check has been successful.
861
	 * @param Jetpack_XMLRPC_Server $xmlrpc_server  (optional) An instance of the server to use instead of instantiating a new one.
862
	 */
863
	public function setup_xmlrpc_handlers(
864
		$request_params,
865
		$is_active,
866
		$is_signed,
867
		Jetpack_XMLRPC_Server $xmlrpc_server = null
868
	) {
869
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::setup_xmlrpc_handlers' );
870
871
		if ( ! $this->connection_manager ) {
872
			$this->connection_manager = new Connection_Manager();
873
		}
874
875
		return $this->connection_manager->setup_xmlrpc_handlers(
876
			$request_params,
877
			$is_active,
878
			$is_signed,
879
			$xmlrpc_server
880
		);
881
	}
882
883
	/**
884
	 * Initialize REST API registration connector.
@@ 5564-5572 (lines=9) @@
5561
	 * @param string         $password Password string.
5562
	 * @return \WP_User|mixed Authenticated user or error.
5563
	 */
5564
	public function authenticate_jetpack( $user, $username, $password ) {
5565
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::authenticate_jetpack' );
5566
5567
		if ( ! $this->connection_manager ) {
5568
			$this->connection_manager = new Connection_Manager();
5569
		}
5570
5571
		return $this->connection_manager->authenticate_jetpack( $user, $username, $password );
5572
	}
5573
5574
	// Authenticates requests from Jetpack server to WP REST API endpoints.
5575
	// Uses the existing XMLRPC request signing implementation.