Code Duplication    Length = 10-13 lines in 2 locations

core/services/shortcodes/ShortcodesManager.php 1 location

@@ 139-151 (lines=13) @@
136
                'FHEE__EventEspresso_core_services_shortcodes_ShortcodesManager__registerShortcodes__shortcode_collection',
137
                $this->getShortcodes()
138
            );
139
            if (! $this->shortcodes instanceof CollectionInterface) {
140
                throw new InvalidEntityException(
141
                    $this->shortcodes,
142
                    'CollectionInterface',
143
                    sprintf(
144
                        esc_html__(
145
                            'The "FHEE__EventEspresso_core_services_shortcodes_ShortcodesManager__registerShortcodes__shortcode_collection" filter must return a Collection of EspressoShortcode objects. "%1$s" was received instead.',
146
                            'event_espresso'
147
                        ),
148
                        is_object($this->shortcodes) ? get_class($this->shortcodes) : gettype($this->shortcodes)
149
                    )
150
                );
151
            }
152
            $this->legacy_shortcodes_manager->registerShortcodes();
153
        } catch (Exception $exception) {
154
            new ExceptionStackTraceDisplay($exception);

core/services/commands/registration/CreateRegistrationCommand.php 1 location

@@ 88-97 (lines=10) @@
85
    ) {
86
        // grab the related ticket object for this line_item
87
        $this->ticket = $ticket_line_item->ticket();
88
        if ( ! $this->ticket instanceof EE_Ticket) {
89
            throw new InvalidEntityException(
90
                is_object($this->ticket) ? get_class($this->ticket) : gettype($this->ticket),
91
                'EE_Ticket',
92
                sprintf(
93
                    __('Line item %s did not contain a valid ticket', 'event_espresso'),
94
                    $ticket_line_item->ID()
95
                )
96
            );
97
        }
98
        $this->transaction = $transaction;
99
        $this->ticket_line_item = $ticket_line_item;
100
        $this->reg_count = absint($reg_count);