Code Duplication    Length = 9-9 lines in 8 locations

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

@@ 5674-5682 (lines=9) @@
5671
	 * @param array $methods XMLRPC methods.
5672
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5673
	 */
5674
	public function xmlrpc_methods( $methods ) {
5675
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5676
5677
		if ( ! $this->connection_manager ) {
5678
			$this->connection_manager = new Connection_Manager();
5679
		}
5680
5681
		return $this->connection_manager->xmlrpc_methods( $methods );
5682
	}
5683
5684
	/**
5685
	 * Register additional public XMLRPC methods.
@@ 5693-5701 (lines=9) @@
5690
	 * @param array $methods Public XMLRPC methods.
5691
	 * @return array Public XMLRPC methods, with the getOptions one.
5692
	 */
5693
	public function public_xmlrpc_methods( $methods ) {
5694
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5695
5696
		if ( ! $this->connection_manager ) {
5697
			$this->connection_manager = new Connection_Manager();
5698
		}
5699
5700
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5701
	}
5702
5703
	/**
5704
	 * Handles a getOptions XMLRPC method call.
@@ 5712-5720 (lines=9) @@
5709
	 * @param array $args method call arguments.
5710
	 * @return array an amended XMLRPC server options array.
5711
	 */
5712
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5713
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5714
5715
		if ( ! $this->connection_manager ) {
5716
			$this->connection_manager = new Connection_Manager();
5717
		}
5718
5719
		return $this->connection_manager->jetpack_getOptions( $args );
5720
	}
5721
5722
	/**
5723
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5731-5739 (lines=9) @@
5728
	 * @param array $options Standard Core options.
5729
	 * @return array Amended options.
5730
	 */
5731
	public function xmlrpc_options( $options ) {
5732
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5733
5734
		if ( ! $this->connection_manager ) {
5735
			$this->connection_manager = new Connection_Manager();
5736
		}
5737
5738
		return $this->connection_manager->xmlrpc_options( $options );
5739
	}
5740
5741
	/**
5742
	 * State is passed via cookies from one request to the next, but never to subsequent requests.
@@ 969-977 (lines=9) @@
966
	 * @deprecated since 7.7.0
967
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
968
	 */
969
	public function initialize_rest_api_registration_connector() {
970
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
971
972
		if ( ! $this->connection_manager ) {
973
			$this->connection_manager = new Connection_Manager();
974
		}
975
976
		$this->connection_manager->initialize_rest_api_registration_connector();
977
	}
978
979
	/**
980
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 1151-1159 (lines=9) @@
1148
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1149
	 * @return array Filtered $methods
1150
	 */
1151
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1152
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1153
1154
		if ( ! $this->connection_manager ) {
1155
			$this->connection_manager = new Connection_Manager();
1156
		}
1157
1158
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1159
	}
1160
1161
	/**
1162
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1171-1179 (lines=9) @@
1168
	 * @deprecated since 7.7.0
1169
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1170
	 */
1171
	public function alternate_xmlrpc() {
1172
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1173
1174
		if ( ! $this->connection_manager ) {
1175
			$this->connection_manager = new Connection_Manager();
1176
		}
1177
1178
		$this->connection_manager->alternate_xmlrpc();
1179
	}
1180
1181
	/**
1182
	 * The callback for the JITM ajax requests.
@@ 1249-1257 (lines=9) @@
1246
	 * @deprecated since 7.7.0
1247
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1248
	 */
1249
	public function require_jetpack_authentication() {
1250
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1251
1252
		if ( ! $this->connection_manager ) {
1253
			$this->connection_manager = new Connection_Manager();
1254
		}
1255
1256
		$this->connection_manager->require_jetpack_authentication();
1257
	}
1258
1259
	/**
1260
	 * Register assets for use in various modules and the Jetpack admin page.