Code Duplication    Length = 21-22 lines in 2 locations

modules/ticket_selector/ProcessTicketSelector.php 1 location

@@ 427-447 (lines=21) @@
424
        // for the last ticket selected PRIOR to subtracting tickets
425
        $available_spaces = $this->ticketDatetimeAvailability($ticket, true);
426
        // greedy greedy greedy eh?
427
        if ($available_spaces > 0) {
428
            if (
429
            apply_filters(
430
                'FHEE__EE_Ticket_Selector___add_ticket_to_cart__allow_display_availability_error',
431
                true,
432
                $ticket,
433
                $qty,
434
                $available_spaces
435
            )
436
            ) {
437
                $this->displayAvailabilityError($available_spaces);
438
            }
439
        } else {
440
            \EE_Error::add_error(
441
                __(
442
                    'We\'re sorry, but there are no available spaces left for this event at this particular date and time.',
443
                    'event_espresso'
444
                ),
445
                __FILE__, __FUNCTION__, __LINE__
446
            );
447
        }
448
        return false;
449
    }
450

modules/single_page_checkout/reg_steps/attendee_information/EE_SPCO_Reg_Step_Attendee_Information.class.php 1 location

@@ 931-952 (lines=22) @@
928
										$input_value = $primary_registrant[ $form_input ];
929
									}
930
									// now attempt to save the input data
931
									if (
932
										! $this->_save_registration_form_input(
933
											$registration,
934
											$form_input,
935
											$input_value
936
										)
937
									) {
938
										EE_Error::add_error(
939
											sprintf(
940
												__(
941
													'Unable to save registration form data for the form input: "%1$s" with the submitted value: "%2$s"',
942
													'event_espresso'
943
												),
944
												$form_input,
945
												$input_value
946
											),
947
											__FILE__,
948
											__FUNCTION__,
949
											__LINE__
950
										);
951
										return false;
952
									}
953
								}
954
							}
955
						}  // end of foreach ( $valid_data[ $reg_url_link ] as $form_section => $form_inputs )