PluginProbe
Booktics – Appointment Booking Calendar for Service Businesses / 1.0.29
Booktics – Appointment Booking Calendar for Service Businesses v1.0.29
1.0.29 1.0.28 1.0.27 1.0.26 1.0.25 1.0.24 1.0.23 1.0.22 1.0.21 1.0.20 1.0.19 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.2 1.0.3 All 31 releases
← All changes | base/services/schedule-record.php +8 -8 1.0.3 → 1.0.29 View file →
@@ -29,14 +29,14 @@
29 29 * @return array
30 30 */
31 31 public function get_schedules( $id, $type = 'team_member' ) {
32 32 $database = new Booktics_Database();
33 - if ( $type === 'default' ) {
33 + if ( 'default' === $type ) {
34 34 $where = array(
35 35 'team_member_id' => 0,
36 36 'service_id' => 0,
37 37 );
38 - } elseif ( $type === 'team_member' ) {
38 + } elseif ( 'team_member' === $type ) {
39 39 $where = array( 'team_member_id' => $id );
40 40 } else {
41 41 $where = array( 'service_id' => $id );
42 42 }
@@ -53,11 +53,11 @@
53 53 return $formatted;
54 54 }
55 55
56 56 foreach ( $schedules as $schedule ) {
57 - if ( $schedule->custom_date == '0' ) {
57 + if ( '0' == $schedule->custom_date ) {
58 58 $day = strtolower( array_search( $schedule->week_day, Schedule_Manager::$day_map ) );
59 - if ( $schedule->start_time == '0' && $schedule->end_time == '0' ) {
59 + if ( '0' == $schedule->start_time && '0' == $schedule->end_time ) {
60 60 continue;
61 61 }
62 62 $formatted['schedule'][ $day ][] = array(
63 63 'start_time' => $this->format_time( $schedule->start_time ),
@@ -62,9 +62,9 @@
62 62 $formatted['schedule'][ $day ][] = array(
63 63 'start_time' => $this->format_time( $schedule->start_time ),
64 64 'end_time' => $this->format_time( $schedule->end_time ),
65 65 );
66 - } elseif ( $schedule->start_time == '0' && $schedule->end_time == '0' ) {
66 + } elseif ( '0' == $schedule->start_time && '0' == $schedule->end_time ) {
67 67 $formatted['holiday'][] = $schedule->custom_date;
68 68 } else {
69 69 $formatted['custom'][] = array(
70 70 $schedule->custom_date,
@@ -106,17 +106,17 @@
106 106 for ( $i = 1; $i <= $dates_count; $i++ ) {
107 107 $current = $dates[ $i ] ?? null;
108 108
109 109 // If we've reached the end or found a gap in dates
110 - if ( $current === null || strtotime( $current ) > strtotime( '+1 day', strtotime( $prev ) ) ) {
110 + if ( null === $current || strtotime( $current ) > strtotime( '+1 day', strtotime( $prev ) ) ) {
111 111 // Add the range only if start and end are different or it's the last single date
112 112 $ranges[] = array( $start, $prev );
113 - if ( $current !== null ) {
113 + if ( null !== $current ) {
114 114 $start = $current;
115 115 }
116 116 }
117 117
118 - if ( $current !== null ) {
118 + if ( null !== $current ) {
119 119 $prev = $current;
120 120 }
121 121 }
122 122