Code Duplication    Length = 9-9 lines in 8 locations

projects/plugins/jetpack/class.jetpack.php 8 locations

@@ 958-966 (lines=9) @@
955
	 * @deprecated since 7.7.0
956
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
957
	 */
958
	public function initialize_rest_api_registration_connector() {
959
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
960
961
		if ( ! $this->connection_manager ) {
962
			$this->connection_manager = new Connection_Manager();
963
		}
964
965
		$this->connection_manager->initialize_rest_api_registration_connector();
966
	}
967
968
	/**
969
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 1117-1125 (lines=9) @@
1114
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1115
	 * @return array Filtered $methods
1116
	 */
1117
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1118
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1119
1120
		if ( ! $this->connection_manager ) {
1121
			$this->connection_manager = new Connection_Manager();
1122
		}
1123
1124
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1125
	}
1126
1127
	/**
1128
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1137-1145 (lines=9) @@
1134
	 * @deprecated since 7.7.0
1135
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1136
	 */
1137
	public function alternate_xmlrpc() {
1138
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1139
1140
		if ( ! $this->connection_manager ) {
1141
			$this->connection_manager = new Connection_Manager();
1142
		}
1143
1144
		$this->connection_manager->alternate_xmlrpc();
1145
	}
1146
1147
	/**
1148
	 * The callback for the JITM ajax requests.
@@ 1215-1223 (lines=9) @@
1212
	 * @deprecated since 7.7.0
1213
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1214
	 */
1215
	public function require_jetpack_authentication() {
1216
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1217
1218
		if ( ! $this->connection_manager ) {
1219
			$this->connection_manager = new Connection_Manager();
1220
		}
1221
1222
		$this->connection_manager->require_jetpack_authentication();
1223
	}
1224
1225
	/**
1226
	 * Register assets for use in various modules and the Jetpack admin page.
@@ 5707-5715 (lines=9) @@
5704
	 * @param array $methods XMLRPC methods.
5705
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5706
	 */
5707
	public function xmlrpc_methods( $methods ) {
5708
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5709
5710
		if ( ! $this->connection_manager ) {
5711
			$this->connection_manager = new Connection_Manager();
5712
		}
5713
5714
		return $this->connection_manager->xmlrpc_methods( $methods );
5715
	}
5716
5717
	/**
5718
	 * Register additional public XMLRPC methods.
@@ 5726-5734 (lines=9) @@
5723
	 * @param array $methods Public XMLRPC methods.
5724
	 * @return array Public XMLRPC methods, with the getOptions one.
5725
	 */
5726
	public function public_xmlrpc_methods( $methods ) {
5727
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5728
5729
		if ( ! $this->connection_manager ) {
5730
			$this->connection_manager = new Connection_Manager();
5731
		}
5732
5733
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5734
	}
5735
5736
	/**
5737
	 * Handles a getOptions XMLRPC method call.
@@ 5745-5753 (lines=9) @@
5742
	 * @param array $args method call arguments.
5743
	 * @return array an amended XMLRPC server options array.
5744
	 */
5745
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5746
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5747
5748
		if ( ! $this->connection_manager ) {
5749
			$this->connection_manager = new Connection_Manager();
5750
		}
5751
5752
		return $this->connection_manager->jetpack_getOptions( $args );
5753
	}
5754
5755
	/**
5756
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5764-5772 (lines=9) @@
5761
	 * @param array $options Standard Core options.
5762
	 * @return array Amended options.
5763
	 */
5764
	public function xmlrpc_options( $options ) {
5765
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5766
5767
		if ( ! $this->connection_manager ) {
5768
			$this->connection_manager = new Connection_Manager();
5769
		}
5770
5771
		return $this->connection_manager->xmlrpc_options( $options );
5772
	}
5773
5774
	/**
5775
	 * State is passed via cookies from one request to the next, but never to subsequent requests.