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

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

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 )

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

@@ 316-327 (lines=12) @@
313
     * @return TableAnalysis
314
     * @throws \EE_Error
315
     */
316
    protected function _get_table_analysis()
317
    {
318
        if ($this->_table_analysis instanceof TableAnalysis) {
319
            return $this->_table_analysis;
320
        } else {
321
            throw new \EE_Error(sprintf(__('Table analysis class on class %1$s is not set properly.', 'event_espresso'),
322
                get_class($this)));
323
        }
324
    }
325
326
327
328
    /**
329
     * This returns a wpdb->results array of all registration date month and years matching the incoming query params
330
     * and grouped by month and year.