Code Duplication    Length = 9-9 lines in 8 locations

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

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