Code Duplication    Length = 9-9 lines in 8 locations

class.jetpack.php 8 locations

@@ 936-944 (lines=9) @@
933
	 * @deprecated since 7.7.0
934
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
935
	 */
936
	public function initialize_rest_api_registration_connector() {
937
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
938
939
		if ( ! $this->connection_manager ) {
940
			$this->connection_manager = new Connection_Manager();
941
		}
942
943
		$this->connection_manager->initialize_rest_api_registration_connector();
944
	}
945
946
	/**
947
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 1062-1070 (lines=9) @@
1059
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1060
	 * @return array Filtered $methods
1061
	 */
1062
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1063
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1064
1065
		if ( ! $this->connection_manager ) {
1066
			$this->connection_manager = new Connection_Manager();
1067
		}
1068
1069
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1070
	}
1071
1072
	/**
1073
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1082-1090 (lines=9) @@
1079
	 * @deprecated since 7.7.0
1080
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1081
	 */
1082
	public function alternate_xmlrpc() {
1083
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1084
1085
		if ( ! $this->connection_manager ) {
1086
			$this->connection_manager = new Connection_Manager();
1087
		}
1088
1089
		$this->connection_manager->alternate_xmlrpc();
1090
	}
1091
1092
	/**
1093
	 * The callback for the JITM ajax requests.
@@ 1160-1168 (lines=9) @@
1157
	 * @deprecated since 7.7.0
1158
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1159
	 */
1160
	public function require_jetpack_authentication() {
1161
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1162
1163
		if ( ! $this->connection_manager ) {
1164
			$this->connection_manager = new Connection_Manager();
1165
		}
1166
1167
		$this->connection_manager->require_jetpack_authentication();
1168
	}
1169
1170
	/**
1171
	 * Register assets for use in various modules and the Jetpack admin page.
@@ 5569-5577 (lines=9) @@
5566
	 * @param array $methods XMLRPC methods.
5567
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5568
	 */
5569
	public function xmlrpc_methods( $methods ) {
5570
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5571
5572
		if ( ! $this->connection_manager ) {
5573
			$this->connection_manager = new Connection_Manager();
5574
		}
5575
5576
		return $this->connection_manager->xmlrpc_methods( $methods );
5577
	}
5578
5579
	/**
5580
	 * Register additional public XMLRPC methods.
@@ 5588-5596 (lines=9) @@
5585
	 * @param array $methods Public XMLRPC methods.
5586
	 * @return array Public XMLRPC methods, with the getOptions one.
5587
	 */
5588
	public function public_xmlrpc_methods( $methods ) {
5589
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5590
5591
		if ( ! $this->connection_manager ) {
5592
			$this->connection_manager = new Connection_Manager();
5593
		}
5594
5595
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5596
	}
5597
5598
	/**
5599
	 * Handles a getOptions XMLRPC method call.
@@ 5607-5615 (lines=9) @@
5604
	 * @param array $args method call arguments.
5605
	 * @return array an amended XMLRPC server options array.
5606
	 */
5607
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5608
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5609
5610
		if ( ! $this->connection_manager ) {
5611
			$this->connection_manager = new Connection_Manager();
5612
		}
5613
5614
		return $this->connection_manager->jetpack_getOptions( $args );
5615
	}
5616
5617
	/**
5618
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5626-5634 (lines=9) @@
5623
	 * @param array $options Standard Core options.
5624
	 * @return array Amended options.
5625
	 */
5626
	public function xmlrpc_options( $options ) {
5627
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5628
5629
		if ( ! $this->connection_manager ) {
5630
			$this->connection_manager = new Connection_Manager();
5631
		}
5632
5633
		return $this->connection_manager->xmlrpc_options( $options );
5634
	}
5635
5636
	/**
5637
	 * State is passed via cookies from one request to the next, but never to subsequent requests.