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.
@@ 5640-5648 (lines=9) @@
5637
	 * @param array $methods XMLRPC methods.
5638
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5639
	 */
5640
	public function xmlrpc_methods( $methods ) {
5641
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5642
5643
		if ( ! $this->connection_manager ) {
5644
			$this->connection_manager = new Connection_Manager();
5645
		}
5646
5647
		return $this->connection_manager->xmlrpc_methods( $methods );
5648
	}
5649
5650
	/**
5651
	 * Register additional public XMLRPC methods.
@@ 5659-5667 (lines=9) @@
5656
	 * @param array $methods Public XMLRPC methods.
5657
	 * @return array Public XMLRPC methods, with the getOptions one.
5658
	 */
5659
	public function public_xmlrpc_methods( $methods ) {
5660
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5661
5662
		if ( ! $this->connection_manager ) {
5663
			$this->connection_manager = new Connection_Manager();
5664
		}
5665
5666
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5667
	}
5668
5669
	/**
5670
	 * Handles a getOptions XMLRPC method call.
@@ 5678-5686 (lines=9) @@
5675
	 * @param array $args method call arguments.
5676
	 * @return array an amended XMLRPC server options array.
5677
	 */
5678
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5679
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5680
5681
		if ( ! $this->connection_manager ) {
5682
			$this->connection_manager = new Connection_Manager();
5683
		}
5684
5685
		return $this->connection_manager->jetpack_getOptions( $args );
5686
	}
5687
5688
	/**
5689
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5697-5705 (lines=9) @@
5694
	 * @param array $options Standard Core options.
5695
	 * @return array Amended options.
5696
	 */
5697
	public function xmlrpc_options( $options ) {
5698
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5699
5700
		if ( ! $this->connection_manager ) {
5701
			$this->connection_manager = new Connection_Manager();
5702
		}
5703
5704
		return $this->connection_manager->xmlrpc_options( $options );
5705
	}
5706
5707
	/**
5708
	 * State is passed via cookies from one request to the next, but never to subsequent requests.