Code Duplication    Length = 13-18 lines in 2 locations

core/db_classes/EE_Ticket.class.php 1 location

@@ 1709-1726 (lines=18) @@
1706
     * @throws ReflectionException
1707
     * @since   $VID:$
1708
     */
1709
    public function set_visibility(int $visibility)
1710
    {
1711
        $ticket_visibility = EEM_Ticket::instance()->ticketVisibility();
1712
        if (! isset($ticket_visibility[ $visibility ])) {
1713
            throw new DomainException(
1714
                sprintf(
1715
                    esc_html__(
1716
                        'The supplied ticket visibility setting of "%1$s" is not valid. It needs to match one of the keys in the following array:%2$s %3$s ',
1717
                        'event_espresso'
1718
                    ),
1719
                    $visibility,
1720
                    '<br />',
1721
                    var_export($ticket_visibility, true)
1722
                )
1723
            );
1724
        }
1725
        $this->set('TKT_visibility', $visibility);
1726
    }
1727
1728
1729
    /*******************************************************************

core/services/helpers/datetime/AbstractHelper.php 1 location

@@ 101-113 (lines=13) @@
98
     * @return int
99
     * @throws DomainException
100
     */
101
    public function getTimezoneOffset(DateTimeZone $date_time_zone, $time = null)
102
    {
103
        $transition = $this->getTimezoneTransitions($date_time_zone, $time);
104
        if (! isset($transition['offset'])) {
105
            throw new DomainException(
106
                sprintf(
107
                    esc_html__('An invalid timezone transition was received %1$s', 'event_espresso'),
108
                    print_r($transition, true)
109
                )
110
            );
111
        }
112
        return $transition['offset'];
113
    }
114
115
116
    /**