Code Duplication    Length = 9-9 lines in 8 locations

class.jetpack.php 8 locations

@@ 934-942 (lines=9) @@
931
	 * @deprecated since 7.7.0
932
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
933
	 */
934
	public function initialize_rest_api_registration_connector() {
935
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
936
937
		if ( ! $this->connection_manager ) {
938
			$this->connection_manager = new Connection_Manager();
939
		}
940
941
		$this->connection_manager->initialize_rest_api_registration_connector();
942
	}
943
944
	/**
945
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 1060-1068 (lines=9) @@
1057
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1058
	 * @return array Filtered $methods
1059
	 */
1060
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1061
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1062
1063
		if ( ! $this->connection_manager ) {
1064
			$this->connection_manager = new Connection_Manager();
1065
		}
1066
1067
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1068
	}
1069
1070
	/**
1071
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1080-1088 (lines=9) @@
1077
	 * @deprecated since 7.7.0
1078
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1079
	 */
1080
	public function alternate_xmlrpc() {
1081
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1082
1083
		if ( ! $this->connection_manager ) {
1084
			$this->connection_manager = new Connection_Manager();
1085
		}
1086
1087
		$this->connection_manager->alternate_xmlrpc();
1088
	}
1089
1090
	/**
1091
	 * The callback for the JITM ajax requests.
@@ 1158-1166 (lines=9) @@
1155
	 * @deprecated since 7.7.0
1156
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1157
	 */
1158
	public function require_jetpack_authentication() {
1159
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1160
1161
		if ( ! $this->connection_manager ) {
1162
			$this->connection_manager = new Connection_Manager();
1163
		}
1164
1165
		$this->connection_manager->require_jetpack_authentication();
1166
	}
1167
1168
	/**
1169
	 * Register assets for use in various modules and the Jetpack admin page.
@@ 5587-5595 (lines=9) @@
5584
	 * @param array $methods XMLRPC methods.
5585
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5586
	 */
5587
	public function xmlrpc_methods( $methods ) {
5588
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5589
5590
		if ( ! $this->connection_manager ) {
5591
			$this->connection_manager = new Connection_Manager();
5592
		}
5593
5594
		return $this->connection_manager->xmlrpc_methods( $methods );
5595
	}
5596
5597
	/**
5598
	 * Register additional public XMLRPC methods.
@@ 5606-5614 (lines=9) @@
5603
	 * @param array $methods Public XMLRPC methods.
5604
	 * @return array Public XMLRPC methods, with the getOptions one.
5605
	 */
5606
	public function public_xmlrpc_methods( $methods ) {
5607
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5608
5609
		if ( ! $this->connection_manager ) {
5610
			$this->connection_manager = new Connection_Manager();
5611
		}
5612
5613
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5614
	}
5615
5616
	/**
5617
	 * Handles a getOptions XMLRPC method call.
@@ 5625-5633 (lines=9) @@
5622
	 * @param array $args method call arguments.
5623
	 * @return array an amended XMLRPC server options array.
5624
	 */
5625
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5626
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5627
5628
		if ( ! $this->connection_manager ) {
5629
			$this->connection_manager = new Connection_Manager();
5630
		}
5631
5632
		return $this->connection_manager->jetpack_getOptions( $args );
5633
	}
5634
5635
	/**
5636
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5644-5652 (lines=9) @@
5641
	 * @param array $options Standard Core options.
5642
	 * @return array Amended options.
5643
	 */
5644
	public function xmlrpc_options( $options ) {
5645
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5646
5647
		if ( ! $this->connection_manager ) {
5648
			$this->connection_manager = new Connection_Manager();
5649
		}
5650
5651
		return $this->connection_manager->xmlrpc_options( $options );
5652
	}
5653
5654
	/**
5655
	 * State is passed via cookies from one request to the next, but never to subsequent requests.