Code Duplication    Length = 4-11 lines in 7 locations

core/EE_Module_Request_Router.core.php 2 locations

@@ 212-218 (lines=7) @@
209
        // instantiate module class
210
        $module = new $module_name();
211
        // ensure that class is actually a module
212
        if (! $module instanceof EED_Module) {
213
            EE_Error::add_error(
214
                sprintf(__('The requested %s module is not of the class EED_Module.', 'event_espresso'), $module_name),
215
                __FILE__,
216
                __FUNCTION__,
217
                __LINE__
218
            );
219
            return null;
220
        }
221
        return $module;
@@ 194-204 (lines=11) @@
191
     */
192
    public static function module_factory($module_name)
193
    {
194
        if ($module_name === 'EED_Module') {
195
            EE_Error::add_error(
196
                sprintf(
197
                    __(
198
                        'EED_Module is an abstract parent class an can not be instantiated. Please provide a proper module name.',
199
                        'event_espresso'
200
                    ),
201
                    $module_name
202
                ),
203
                __FILE__,
204
                __FUNCTION__,
205
                __LINE__
206
            );
207
            return null;

core/business/EE_Transaction_Payments.class.php 4 locations

@@ 65-71 (lines=7) @@
62
    public function recalculate_transaction_total(EE_Transaction $transaction, $update_txn = true)
63
    {
64
        $total_line_item = $transaction->total_line_item();
65
        if (! $total_line_item instanceof EE_Line_Item) {
66
            EE_Error::add_error(
67
                sprintf(
68
                    __('The Total Line Item for Transaction %1$d\'s was not found or is invalid.', 'event_espresso'),
69
                    $transaction->ID()
70
                ),
71
                __FILE__,
72
                __FUNCTION__,
73
                __LINE__
74
            );
@@ 104-107 (lines=4) @@
101
    public function calculate_total_payments_and_update_status(EE_Transaction $transaction, $update_txn = true)
102
    {
103
        // verify transaction
104
        if (! $transaction instanceof EE_Transaction) {
105
            EE_Error::add_error(
106
                __('Please provide a valid EE_Transaction object.', 'event_espresso'),
107
                __FILE__,
108
                __FUNCTION__,
109
                __LINE__
110
            );
@@ 148-151 (lines=4) @@
145
        $payment_status = EEM_Payment::status_id_approved
146
    ) {
147
        // verify transaction
148
        if (! $transaction instanceof EE_Transaction) {
149
            EE_Error::add_error(
150
                __('Please provide a valid EE_Transaction object.', 'event_espresso'),
151
                __FILE__,
152
                __FUNCTION__,
153
                __LINE__
154
            );
@@ 333-339 (lines=7) @@
330
            '5.0.0'
331
        );
332
        // verify transaction
333
        if (! $transaction instanceof EE_Transaction) {
334
            EE_Error::add_error(
335
                __('Please provide a valid EE_Transaction object.', 'event_espresso'),
336
                __FILE__,
337
                __FUNCTION__,
338
                __LINE__
339
            );
340
            return false;
341
        }
342
        // set transaction status based on comparison of TXN_paid vs TXN_total

core/libraries/payment_methods/EE_PMT_Base.lib.php 1 location

@@ 521-524 (lines=4) @@
518
     */
519
    protected function _save_billing_info_to_attendee($billing_form, $transaction)
520
    {
521
        if (! $transaction || ! $transaction instanceof EE_Transaction) {
522
            EE_Error::add_error(
523
                __("Cannot save billing info because no transaction was specified", "event_espresso"),
524
                __FILE__,
525
                __FUNCTION__,
526
                __LINE__
527
            );