@@ -31,11 +31,11 @@ public function __construct( array $args ) {
3131 $ this ->daily_limit = (int ) $ args ['daily_limit ' ];
3232
3333 if ( empty ( $ this ->service_ids ) || $ this ->daily_limit < 1 ) {
34- return ;
35- }
34+ return ;
35+ }
3636
3737 // Guard creation and REST availability so the cap is enforced everywhere.
38- add_action ( 'gpb_before_booking_created ' , array ( $ this , 'guard_booking_creation ' ), 10 , 2 );
38+ add_action ( 'gpb_before_booking_created ' , array ( $ this , 'guard_booking_creation ' ), 10 , 2 );
3939 add_filter ( 'rest_post_dispatch ' , array ( $ this , 'filter_rest_availability ' ), 10 , 3 );
4040 }
4141
@@ -109,7 +109,7 @@ public function filter_rest_availability( $response, $server, $request ) {
109109 return $ response ;
110110 }
111111
112- private function exceeds_limit ( array $ dates , int $ incoming_quantity = 0 , ? int $ exclude_booking_id = null ): bool {
112+ private function exceeds_limit ( array $ dates , int $ incoming_quantity = 0 , $ exclude_booking_id = null ): bool {
113113 $ dates = array_filter ( array_unique ( $ dates ) );
114114 $ totals = $ dates ? $ this ->get_daily_totals ( $ dates , $ exclude_booking_id ) : array ();
115115
@@ -123,7 +123,7 @@ private function exceeds_limit( array $dates, int $incoming_quantity = 0, ?int $
123123 return false ;
124124 }
125125
126- private function get_daily_totals ( array $ dates , ? int $ exclude_booking_id = null ): array {
126+ private function get_daily_totals ( array $ dates , $ exclude_booking_id = null ): array {
127127 $ dates = array_values ( array_filter ( array_unique ( array_map ( 'trim ' , $ dates ) ) ) );
128128 if ( ! $ dates ) {
129129 return array ();
@@ -135,7 +135,7 @@ private function get_daily_totals( array $dates, ?int $exclude_booking_id = null
135135 return $ this ->get_totals_for_range ( $ start_datetime , $ end_datetime , $ exclude_booking_id );
136136 }
137137
138- private function get_totals_for_range ( string $ start_datetime , string $ end_datetime , ? int $ exclude_booking_id = null ): array {
138+ private function get_totals_for_range ( string $ start_datetime , string $ end_datetime , $ exclude_booking_id = null ): array {
139139 if ( '' === $ start_datetime || '' === $ end_datetime ) {
140140 return array ();
141141 }
0 commit comments