Code Duplication    Length = 20-20 lines in 2 locations

modules/ticket_selector/DisplayTicketSelector.php 2 locations

@@ 304-323 (lines=20) @@
301
     * @return string
302
     * @throws EE_Error
303
     */
304
    protected function noTicketAvailableMessage()
305
    {
306
        $no_ticket_available_msg = esc_html__('We\'re sorry, but all ticket sales have ended.', 'event_espresso');
307
        if (current_user_can('edit_post', $this->event->ID())) {
308
            $no_ticket_available_msg .= sprintf(
309
                esc_html__(
310
                    '%1$sNote to Event Admin:%2$sNo tickets were found for this event. This effectively turns off ticket sales. Please ensure that at least one ticket is available for if you want people to be able to register.%3$s(click to edit this event)%4$s',
311
                    'event_espresso'
312
                ),
313
                '<div class="ee-attention" style="text-align: left;"><b>',
314
                '</b><br />',
315
                '<span class="edit-link"><a class="post-edit-link" href="'
316
                . get_edit_post_link($this->event->ID())
317
                . '">',
318
                '</a></span></div><!-- .ee-attention noTicketAvailableMessage -->'
319
            );
320
        }
321
        return '
322
            <div class="ee-event-expired-notice">
323
                <span class="important-notice">' . $no_ticket_available_msg . '</span>
324
            </div><!-- .ee-event-expired-notice -->';
325
    }
326
@@ 335-354 (lines=20) @@
332
     * @return string
333
     * @throws EE_Error
334
     */
335
    protected function ticketSalesClosedMessage()
336
    {
337
        $sales_closed_msg = esc_html__(
338
            'We\'re sorry, but ticket sales have been closed at this time. Please check back again later.',
339
            'event_espresso'
340
        );
341
        if (current_user_can('edit_post', $this->event->ID())) {
342
            $sales_closed_msg .= sprintf(
343
                esc_html__(
344
                    '%sNote to Event Admin:%sThe "Maximum number of tickets allowed per order for this event" in the Event Registration Options has been set to "0". This effectively turns off ticket sales. %s(click to edit this event)%s',
345
                    'event_espresso'
346
                ),
347
                '<div class="ee-attention" style="text-align: left;"><b>',
348
                '</b><br />',
349
                '<span class="edit-link"><a class="post-edit-link" href="'
350
                . get_edit_post_link($this->event->ID())
351
                . '">',
352
                '</a></span></div><!-- .ee-attention ticketSalesClosedMessage -->'
353
            );
354
        }
355
        return '<p><span class="important-notice">' . $sales_closed_msg . '</span></p>';
356
    }
357