Code Duplication    Length = 20-20 lines in 2 locations

modules/ticket_selector/DisplayTicketSelector.php 2 locations

@@ 270-289 (lines=20) @@
267
     * @return string
268
     * @throws EE_Error
269
     */
270
    protected function noTicketAvailableMessage()
271
    {
272
        $no_ticket_available_msg = esc_html__( 'We\'re sorry, but all ticket sales have ended.', 'event_espresso' );
273
        if (current_user_can('edit_post', $this->event->ID())) {
274
            $no_ticket_available_msg .= sprintf(
275
                esc_html__(
276
                    '%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',
277
                    'event_espresso'
278
                ),
279
                '<div class="ee-attention" style="text-align: left;"><b>',
280
                '</b><br />',
281
                '<span class="edit-link"><a class="post-edit-link" href="'.get_edit_post_link($this->event->ID()).'">',
282
                '</a></span></div><!-- .ee-attention noTicketAvailableMessage -->'
283
            );
284
        }
285
        return '
286
            <div class="ee-event-expired-notice">
287
                <span class="important-notice">' . $no_ticket_available_msg . '</span>
288
            </div><!-- .ee-event-expired-notice -->';
289
    }
290
291
292
@@ 300-319 (lines=20) @@
297
     * @return string
298
     * @throws EE_Error
299
     */
300
    protected function ticketSalesClosedMessage()
301
    {
302
        $sales_closed_msg = esc_html__(
303
            'We\'re sorry, but ticket sales have been closed at this time. Please check back again later.',
304
            'event_espresso'
305
        );
306
        if (current_user_can('edit_post', $this->event->ID())) {
307
            $sales_closed_msg .= sprintf(
308
                esc_html__(
309
                    '%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',
310
                    'event_espresso'
311
                ),
312
                '<div class="ee-attention" style="text-align: left;"><b>',
313
                '</b><br />',
314
                '<span class="edit-link"><a class="post-edit-link" href="'.get_edit_post_link($this->event->ID()).'">',
315
                '</a></span></div><!-- .ee-attention ticketSalesClosedMessage -->'
316
            );
317
        }
318
        return '<p><span class="important-notice">' . $sales_closed_msg . '</span></p>';
319
    }
320
321
322