Code Duplication    Length = 9-9 lines in 8 locations

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

@@ 957-965 (lines=9) @@
954
	 * @deprecated since 7.7.0
955
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
956
	 */
957
	public function initialize_rest_api_registration_connector() {
958
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
959
960
		if ( ! $this->connection_manager ) {
961
			$this->connection_manager = new Connection_Manager();
962
		}
963
964
		$this->connection_manager->initialize_rest_api_registration_connector();
965
	}
966
967
	/**
968
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 1129-1137 (lines=9) @@
1126
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1127
	 * @return array Filtered $methods
1128
	 */
1129
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1130
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1131
1132
		if ( ! $this->connection_manager ) {
1133
			$this->connection_manager = new Connection_Manager();
1134
		}
1135
1136
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1137
	}
1138
1139
	/**
1140
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1149-1157 (lines=9) @@
1146
	 * @deprecated since 7.7.0
1147
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1148
	 */
1149
	public function alternate_xmlrpc() {
1150
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1151
1152
		if ( ! $this->connection_manager ) {
1153
			$this->connection_manager = new Connection_Manager();
1154
		}
1155
1156
		$this->connection_manager->alternate_xmlrpc();
1157
	}
1158
1159
	/**
1160
	 * The callback for the JITM ajax requests.
@@ 1227-1235 (lines=9) @@
1224
	 * @deprecated since 7.7.0
1225
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1226
	 */
1227
	public function require_jetpack_authentication() {
1228
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1229
1230
		if ( ! $this->connection_manager ) {
1231
			$this->connection_manager = new Connection_Manager();
1232
		}
1233
1234
		$this->connection_manager->require_jetpack_authentication();
1235
	}
1236
1237
	/**
1238
	 * Register assets for use in various modules and the Jetpack admin page.
@@ 5698-5706 (lines=9) @@
5695
	 * @param array $methods XMLRPC methods.
5696
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5697
	 */
5698
	public function xmlrpc_methods( $methods ) {
5699
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5700
5701
		if ( ! $this->connection_manager ) {
5702
			$this->connection_manager = new Connection_Manager();
5703
		}
5704
5705
		return $this->connection_manager->xmlrpc_methods( $methods );
5706
	}
5707
5708
	/**
5709
	 * Register additional public XMLRPC methods.
@@ 5717-5725 (lines=9) @@
5714
	 * @param array $methods Public XMLRPC methods.
5715
	 * @return array Public XMLRPC methods, with the getOptions one.
5716
	 */
5717
	public function public_xmlrpc_methods( $methods ) {
5718
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5719
5720
		if ( ! $this->connection_manager ) {
5721
			$this->connection_manager = new Connection_Manager();
5722
		}
5723
5724
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5725
	}
5726
5727
	/**
5728
	 * Handles a getOptions XMLRPC method call.
@@ 5736-5744 (lines=9) @@
5733
	 * @param array $args method call arguments.
5734
	 * @return array an amended XMLRPC server options array.
5735
	 */
5736
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5737
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5738
5739
		if ( ! $this->connection_manager ) {
5740
			$this->connection_manager = new Connection_Manager();
5741
		}
5742
5743
		return $this->connection_manager->jetpack_getOptions( $args );
5744
	}
5745
5746
	/**
5747
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5755-5763 (lines=9) @@
5752
	 * @param array $options Standard Core options.
5753
	 * @return array Amended options.
5754
	 */
5755
	public function xmlrpc_options( $options ) {
5756
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5757
5758
		if ( ! $this->connection_manager ) {
5759
			$this->connection_manager = new Connection_Manager();
5760
		}
5761
5762
		return $this->connection_manager->xmlrpc_options( $options );
5763
	}
5764
5765
	/**
5766
	 * State is passed via cookies from one request to the next, but never to subsequent requests.