Code Duplication    Length = 9-9 lines in 8 locations

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

@@ 955-963 (lines=9) @@
952
	 * @deprecated since 7.7.0
953
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
954
	 */
955
	public function initialize_rest_api_registration_connector() {
956
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
957
958
		if ( ! $this->connection_manager ) {
959
			$this->connection_manager = new Connection_Manager();
960
		}
961
962
		$this->connection_manager->initialize_rest_api_registration_connector();
963
	}
964
965
	/**
966
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 1114-1122 (lines=9) @@
1111
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1112
	 * @return array Filtered $methods
1113
	 */
1114
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1115
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1116
1117
		if ( ! $this->connection_manager ) {
1118
			$this->connection_manager = new Connection_Manager();
1119
		}
1120
1121
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1122
	}
1123
1124
	/**
1125
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1134-1142 (lines=9) @@
1131
	 * @deprecated since 7.7.0
1132
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1133
	 */
1134
	public function alternate_xmlrpc() {
1135
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1136
1137
		if ( ! $this->connection_manager ) {
1138
			$this->connection_manager = new Connection_Manager();
1139
		}
1140
1141
		$this->connection_manager->alternate_xmlrpc();
1142
	}
1143
1144
	/**
1145
	 * The callback for the JITM ajax requests.
@@ 1212-1220 (lines=9) @@
1209
	 * @deprecated since 7.7.0
1210
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1211
	 */
1212
	public function require_jetpack_authentication() {
1213
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1214
1215
		if ( ! $this->connection_manager ) {
1216
			$this->connection_manager = new Connection_Manager();
1217
		}
1218
1219
		$this->connection_manager->require_jetpack_authentication();
1220
	}
1221
1222
	/**
1223
	 * Register assets for use in various modules and the Jetpack admin page.
@@ 5642-5650 (lines=9) @@
5639
	 * @param array $methods XMLRPC methods.
5640
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5641
	 */
5642
	public function xmlrpc_methods( $methods ) {
5643
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5644
5645
		if ( ! $this->connection_manager ) {
5646
			$this->connection_manager = new Connection_Manager();
5647
		}
5648
5649
		return $this->connection_manager->xmlrpc_methods( $methods );
5650
	}
5651
5652
	/**
5653
	 * Register additional public XMLRPC methods.
@@ 5661-5669 (lines=9) @@
5658
	 * @param array $methods Public XMLRPC methods.
5659
	 * @return array Public XMLRPC methods, with the getOptions one.
5660
	 */
5661
	public function public_xmlrpc_methods( $methods ) {
5662
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5663
5664
		if ( ! $this->connection_manager ) {
5665
			$this->connection_manager = new Connection_Manager();
5666
		}
5667
5668
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5669
	}
5670
5671
	/**
5672
	 * Handles a getOptions XMLRPC method call.
@@ 5680-5688 (lines=9) @@
5677
	 * @param array $args method call arguments.
5678
	 * @return array an amended XMLRPC server options array.
5679
	 */
5680
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5681
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5682
5683
		if ( ! $this->connection_manager ) {
5684
			$this->connection_manager = new Connection_Manager();
5685
		}
5686
5687
		return $this->connection_manager->jetpack_getOptions( $args );
5688
	}
5689
5690
	/**
5691
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5699-5707 (lines=9) @@
5696
	 * @param array $options Standard Core options.
5697
	 * @return array Amended options.
5698
	 */
5699
	public function xmlrpc_options( $options ) {
5700
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5701
5702
		if ( ! $this->connection_manager ) {
5703
			$this->connection_manager = new Connection_Manager();
5704
		}
5705
5706
		return $this->connection_manager->xmlrpc_options( $options );
5707
	}
5708
5709
	/**
5710
	 * State is passed via cookies from one request to the next, but never to subsequent requests.