Code Duplication    Length = 12-12 lines in 8 locations

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

admin_pages/payments/Payments_Admin_Page_Init.core.php 1 location

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

core/services/database/TableManager.php 1 location

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

core/db_models/EEM_Registration.model.php 1 location

@@ 394-405 (lines=12) @@
391
     * @return TableAnalysis
392
     * @throws EE_Error
393
     */
394
    protected function _get_table_analysis()
395
    {
396
        if ($this->_table_analysis instanceof TableAnalysis) {
397
            return $this->_table_analysis;
398
        }
399
        throw new EE_Error(
400
            sprintf(
401
                esc_html__('Table analysis class on class %1$s is not set properly.', 'event_espresso'),
402
                get_class($this)
403
            )
404
        );
405
    }
406
407
408
    /**

caffeinated/brewing_regular.php 1 location

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

core/EE_Data_Migration_Manager.core.php 2 locations

@@ 1041-1052 (lines=12) @@
1038
	 * @return TableAnalysis
1039
	 * @throws \EE_Error
1040
	 */
1041
	protected function _get_table_analysis() {
1042
		if( $this->_table_analysis instanceof TableAnalysis ) {
1043
			return $this->_table_analysis;
1044
		} else {
1045
			throw new \EE_Error(
1046
				sprintf(
1047
					__( 'Table analysis class on class %1$s is not set properly.', 'event_espresso'),
1048
					get_class( $this )
1049
				)
1050
			);
1051
		}
1052
	}
1053
1054
	/**
1055
	 * Gets the injected table manager, or throws an exception
@@ 1059-1070 (lines=12) @@
1056
	 * @return TableManager
1057
	 * @throws \EE_Error
1058
	 */
1059
	protected function _get_table_manager() {
1060
		if( $this->_table_manager instanceof TableManager ) {
1061
			return $this->_table_manager;
1062
		} else {
1063
			throw new \EE_Error(
1064
				sprintf(
1065
					__( 'Table manager class on class %1$s is not set properly.', 'event_espresso'),
1066
					get_class( $this )
1067
				)
1068
			);
1069
		}
1070
	}
1071
}
1072