Code Duplication    Length = 11-15 lines in 3 locations

core/EE_Registry.core.php 1 location

@@ 847-857 (lines=11) @@
844
            // get the file
845
            require_once($path);
846
            // if the class isn't already declared somewhere
847
            if (class_exists($class_name, false) === false) {
848
                // so sorry, not a class
849
                throw new EE_Error(
850
                    sprintf(
851
                        __('The %s file %s does not appear to contain the %s Class.', 'event_espresso'),
852
                        $type,
853
                        $path,
854
                        $class_name
855
                    )
856
                );
857
            }
858
        } catch (EE_Error $e) {
859
            $e->get_error();
860
            return false;

core/db_models/EEM_Base.model.php 2 locations

@@ 4150-4164 (lines=15) @@
4147
            }
4148
            $cleaned_value = $this->_construct_between_value($value, $field_obj);
4149
            return $operator . SP . $cleaned_value;
4150
        } elseif (in_array($operator, $this->_null_style_operators)) {
4151
            if ($value !== null) {
4152
                throw new EE_Error(
4153
                    sprintf(
4154
                        __(
4155
                            "You attempted to give a value  (%s) while using a NULL-style operator (%s). That isn't valid",
4156
                            "event_espresso"
4157
                        ),
4158
                        $value,
4159
                        $operator
4160
                    )
4161
                );
4162
            }
4163
            return $operator;
4164
        } elseif ($operator === 'LIKE' && ! is_array($value)) {
4165
            //if the operator is 'LIKE', we want to allow percent signs (%) and not
4166
            //remove other junk. So just treat it as a string.
4167
            return $operator . SP . $this->_wpdb_prepare_using_field($value, '%s');
@@ 4170-4181 (lines=12) @@
4167
            return $operator . SP . $this->_wpdb_prepare_using_field($value, '%s');
4168
        } elseif (! in_array($operator, $this->_in_style_operators) && ! is_array($value)) {
4169
            return $operator . SP . $this->_wpdb_prepare_using_field($value, $field_obj);
4170
        } elseif (in_array($operator, $this->_in_style_operators) && ! is_array($value)) {
4171
            throw new EE_Error(
4172
                sprintf(
4173
                    __(
4174
                        "Operator '%s' must be used with an array of values, eg 'Registration.REG_ID' => array('%s',array(1,2,3))",
4175
                        'event_espresso'
4176
                    ),
4177
                    $operator,
4178
                    $operator
4179
                )
4180
            );
4181
        } elseif (! in_array($operator, $this->_in_style_operators) && is_array($value)) {
4182
            throw new EE_Error(
4183
                sprintf(
4184
                    __(