@@ -228,7 +228,7 @@ public function parseEvent($calendar, $userHref, $oldCalendar = null): array
228228
229229 $ eventInfo = $ oldEventInfo ;
230230
231- if (in_array ($ eventInfo ['organizer ' ], $ userHref )) {
231+ if (in_array ($ eventInfo ['organizer ' ], $ userHref, true )) {
232232 // This is an organizer deleting the event.
233233 $ eventInfo ['attendees ' ] = [];
234234 // Increasing the sequence, but only if the organizer deleted
@@ -237,7 +237,7 @@ public function parseEvent($calendar, $userHref, $oldCalendar = null): array
237237 } else {
238238 // This is an attendee deleting the event.
239239 foreach ($ eventInfo ['attendees ' ] as $ key => $ attendee ) {
240- if (in_array ($ attendee ['href ' ], $ userHref )) {
240+ if (in_array ($ attendee ['href ' ], $ userHref, true )) {
241241 $ eventInfo ['attendees ' ][$ key ]['instances ' ] = ['master ' => ['id ' => 'master ' , 'partstat ' => 'DECLINED ' ],
242242 ];
243243 }
@@ -247,13 +247,13 @@ public function parseEvent($calendar, $userHref, $oldCalendar = null): array
247247 }
248248
249249 // Check if the user is the organizer
250- if (in_array ($ eventInfo ['organizer ' ], $ userHref )) {
250+ if (in_array ($ eventInfo ['organizer ' ], $ userHref, true )) {
251251 return $ this ->parseEventForOrganizer ($ baseCalendar , $ eventInfo , $ oldEventInfo );
252252 }
253253
254254 // Check if the user is an attendee
255255 foreach ($ eventInfo ['attendees ' ] as $ attendee ) {
256- if (in_array ($ attendee ['href ' ], $ userHref )) {
256+ if (in_array ($ attendee ['href ' ], $ userHref, true )) {
257257 // If this is a event update, we always generate a reply
258258 if ($ oldCalendar ) {
259259 return $ this ->parseEventForAttendee ($ baseCalendar , $ eventInfo , $ oldEventInfo , $ attendee ['href ' ]);
@@ -566,7 +566,7 @@ protected function parseEventForOrganizer(VCalendar $calendar, array $eventInfo,
566566
567567 $ message ->significantChange =
568568 'REQUEST ' === $ attendee ['forceSend ' ]
569- || count ($ oldAttendeeInstances ) != count ($ newAttendeeInstances )
569+ || count ($ oldAttendeeInstances ) !== count ($ newAttendeeInstances )
570570 || count (array_diff ($ oldAttendeeInstances , $ newAttendeeInstances )) > 0
571571 || $ oldEventInfo ['significantChangeHash ' ] !== $ eventInfo ['significantChangeHash ' ];
572572
@@ -576,9 +576,9 @@ protected function parseEventForOrganizer(VCalendar $calendar, array $eventInfo,
576576 // We need to find a list of events that the attendee
577577 // is not a part of to add to the list of exceptions.
578578 $ exceptions = [];
579- foreach ($ eventInfo ['instances ' ] as $ instanceId => $ vevent ) {
580- if (!isset ($ attendee ['newInstances ' ][$ instanceId ])) {
581- $ exceptions [] = $ instanceId ;
579+ foreach ($ eventInfo ['instances ' ] as $ eventInstanceId => $ vevent ) {
580+ if (!isset ($ attendee ['newInstances ' ][$ eventInstanceId ])) {
581+ $ exceptions [] = $ eventInstanceId ;
582582 }
583583 }
584584
@@ -648,7 +648,7 @@ protected function parseEventForAttendee(VCalendar $calendar, array $eventInfo,
648648 return [];
649649 }
650650
651- $ oldInstances = ! empty ( $ oldEventInfo ['attendees ' ][$ attendee][ ' instances ' ]) ?
651+ $ oldInstances = array_key_exists ( ' instances ' , $ oldEventInfo ['attendees ' ][$ attendee ]) ?
652652 $ oldEventInfo ['attendees ' ][$ attendee ]['instances ' ] :
653653 [];
654654
@@ -679,7 +679,7 @@ protected function parseEventForAttendee(VCalendar $calendar, array $eventInfo,
679679 // We only need to do that though, if the master event is not declined.
680680 if (isset ($ instances ['master ' ]) && 'DECLINED ' !== $ instances ['master ' ]['newstatus ' ]) {
681681 foreach ($ eventInfo ['exdate ' ] as $ exDate ) {
682- if (!in_array ($ exDate , $ oldEventInfo ['exdate ' ] ?? [])) {
682+ if (!in_array ($ exDate , $ oldEventInfo ['exdate ' ] ?? [], true )) {
683683 if (isset ($ instances [$ exDate ])) {
684684 $ instances [$ exDate ]['newstatus ' ] = 'DECLINED ' ;
685685 } else {
@@ -722,7 +722,7 @@ protected function parseEventForAttendee(VCalendar $calendar, array $eventInfo,
722722 $ hasReply = false ;
723723
724724 foreach ($ instances as $ instance ) {
725- if ($ instance ['oldstatus ' ] == $ instance ['newstatus ' ] && 'REPLY ' !== $ eventInfo ['organizerForceSend ' ]) {
725+ if ($ instance ['oldstatus ' ] === $ instance ['newstatus ' ] && 'REPLY ' !== $ eventInfo ['organizerForceSend ' ]) {
726726 // Skip
727727 continue ;
728728 }
@@ -884,7 +884,7 @@ protected function parseEventInfo(VCalendar $calendar): array
884884 foreach ($ vevent ->select ('RRULE ' ) as $ rr ) {
885885 foreach ($ rr ->getParts () as $ key => $ val ) {
886886 // ignore default values (https://github.com/sabre-io/vobject/issues/126)
887- if ('INTERVAL ' === $ key && 1 == $ val ) {
887+ if ('INTERVAL ' === $ key && 1 === $ val ) {
888888 continue ;
889889 }
890890 if (is_array ($ val )) {
@@ -951,6 +951,7 @@ protected function parseEventInfo(VCalendar $calendar): array
951951 }
952952
953953 foreach ($ this ->significantChangeProperties as $ prop ) {
954+ // @phpstan-ignore property.dynamicName
954955 if (isset ($ vevent ->$ prop )) {
955956 $ propertyValues = $ vevent ->select ($ prop );
956957
0 commit comments