Code Duplication    Length = 12-12 lines in 8 locations

admin_pages/payments/Payments_Admin_Page_Init.core.php 1 location

@@ 103-114 (lines=12) @@
100
	 * @return TableAnalysis
101
	 * @throws \EE_Error
102
	 */
103
	protected function _get_table_analysis() {
104
		if( $this->_table_analysis instanceof TableAnalysis ) {
105
			return $this->_table_analysis;
106
		} else {
107
			throw new \EE_Error( 
108
				sprintf( 
109
					__( 'Table analysis class on class %1$s is not set properly.', 'event_espresso'), 
110
					get_class( $this ) 
111
				) 
112
			);
113
		}
114
	}
115
116
} //end class Payments_Admin_Page_Init
117

core/data_migration_scripts/EE_Data_Migration_Class_Base.core.php 2 locations

@@ 311-322 (lines=12) @@
308
	 * @return TableManager
309
	 * @throws EE_Error
310
	 */
311
	protected function _get_table_manager() {
312
		if( $this->_table_manager instanceof TableManager ) {
313
			return $this->_table_manager;
314
		} else {
315
			throw new EE_Error( 
316
				sprintf( 
317
					__( 'Table manager on migration class %1$s is not set properly.', 'event_espresso'), 
318
					get_class( $this ) 
319
				) 	
320
			);
321
		}
322
	}
323
	
324
	/**
325
	 * Gets the injected table analyzer, or throws an exception
@@ 329-340 (lines=12) @@
326
	 * @return TableAnalysis
327
	 * @throws EE_Error
328
	 */
329
	protected function _get_table_analysis() {
330
		if( $this->_table_analysis instanceof TableAnalysis ) {
331
			return $this->_table_analysis;
332
		} else {
333
			throw new EE_Error( 
334
				sprintf( 
335
					__( 'Table analysis class on migration class %1$s is not set properly.', 'event_espresso'), 
336
					get_class( $this ) 
337
				) 
338
			);
339
		}
340
	}
341
}
342
// end of file: /core/EE_Data_Migration_Class_Base.core.php

core/db_models/EEM_Registration.model.php 1 location

@@ 282-293 (lines=12) @@
279
	 * @return TableAnalysis
280
	 * @throws \EE_Error
281
	 */
282
	protected function _get_table_analysis() {
283
		if( $this->_table_analysis instanceof TableAnalysis ) {
284
			return $this->_table_analysis;
285
		} else {
286
			throw new \EE_Error( 
287
				sprintf( 
288
					__( 'Table analysis class on class %1$s is not set properly.', 'event_espresso'), 
289
					get_class( $this ) 
290
				) 
291
			);
292
		}
293
	}
294
295
296

core/EE_Data_Migration_Manager.core.php 2 locations

@@ 1029-1040 (lines=12) @@
1026
	 * @return TableAnalysis
1027
	 * @throws \EE_Error
1028
	 */
1029
	protected function _get_table_analysis() {
1030
		if( $this->_table_analysis instanceof TableAnalysis ) {
1031
			return $this->_table_analysis;
1032
		} else {
1033
			throw new \EE_Error( 
1034
				sprintf( 
1035
					__( 'Table analysis class on class %1$s is not set properly.', 'event_espresso'), 
1036
					get_class( $this ) 
1037
				) 
1038
			);
1039
		}
1040
	}
1041
	
1042
	/**
1043
	 * Gets the injected table manager, or throws an exception
@@ 1047-1058 (lines=12) @@
1044
	 * @return TableManager
1045
	 * @throws \EE_Error
1046
	 */
1047
	protected function _get_table_manager() {
1048
		if( $this->_table_manager instanceof TableManager ) {
1049
			return $this->_table_manager;
1050
		} else {
1051
			throw new \EE_Error( 
1052
				sprintf( 
1053
					__( 'Table manager class on class %1$s is not set properly.', 'event_espresso'), 
1054
					get_class( $this ) 
1055
				) 
1056
			);
1057
		}
1058
	}
1059
}
1060

core/services/database/TableManager.php 1 location

@@ 40-51 (lines=12) @@
37
	 * @return TableAnalysis
38
	 * @throws \EE_Error
39
	 */
40
	protected function getTableAnalysis() {
41
		if( $this->table_analysis instanceof TableAnalysis ) {
42
			return $this->table_analysis;
43
		} else {
44
			throw new \EE_Error( 
45
				sprintf( 
46
					__( 'Table analysis class on class %1$s is not set properly.', 'event_espresso'), 
47
					get_class( $this ) 
48
				) 
49
			);
50
		}
51
	}
52
53
54

caffeinated/brewing_regular.php 1 location

@@ 269-280 (lines=12) @@
266
	 * @return TableAnalysis
267
	 * @throws \EE_Error
268
	 */
269
	protected function _get_table_analysis() {
270
		if( $this->_table_analysis instanceof TableAnalysis ) {
271
			return $this->_table_analysis;
272
		} else {
273
			throw new \EE_Error( 
274
				sprintf( 
275
					__( 'Table analysis class on class %1$s is not set properly.', 'event_espresso'), 
276
					get_class( $this ) 
277
				) 
278
			);
279
		}
280
	}
281
}
282
$brewing = new EE_Brewing_Regular(
283
	EE_Registry::instance()->create( 'TableAnalysis', array(), true )