Code Duplication    Length = 9-10 lines in 2 locations

classes/helpers/FrmAppHelper.php 1 location

@@ 1148-1156 (lines=9) @@
1145
	/**
1146
	 * @since 2.2.10
1147
	 */
1148
	public static function custom_style_value( $values, $post_values ) {
1149
		if ( $post_values && isset( $post_values['options']['custom_style'] ) ) {
1150
			$custom_style = absint( $post_values['options']['custom_style'] );
1151
		} else {
1152
			$frm_settings = FrmAppHelper::get_settings();
1153
			$custom_style = ( $frm_settings->load_style != 'none' );
1154
		}
1155
		return $custom_style;
1156
	}
1157
1158
	public static function get_meta_value( $field_id, $entry ) {
1159
		_deprecated_function( __FUNCTION__, '2.0.9', 'FrmEntryMeta::get_meta_value' );

classes/models/FrmEntry.php 1 location

@@ 663-672 (lines=10) @@
660
	* @param array $values
661
	* @return int
662
	*/
663
	private static function get_entry_user_id( $values ) {
664
		if ( isset( $values['frm_user_id'] ) && ( is_numeric( $values['frm_user_id'] ) || FrmAppHelper::is_admin() ) ) {
665
			$user_id = $values['frm_user_id'];
666
		} else {
667
			$current_user_id = get_current_user_id();
668
			$user_id = $current_user_id ? $current_user_id : 0;
669
		}
670
671
		return $user_id;
672
	}
673
674
	/**
675
	* Insert new entry into the database