File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -557,12 +557,12 @@ public function getDates(?int $maxdate = null) : array
557557 }
558558 }
559559
560- if ('u ' == $ this ->repeatmode && $ rdates [\ count ($ rdates ) - 1 ] > $ this ->until )
560+ if ('u ' == $ this ->repeatmode && $ rdates [( \is_countable ( $ rdates ) ? \ count ($ rdates) : 0 ) - 1 ] > $ this ->until )
561561 {
562562 // erase last item
563563 \array_pop ($ rdates );
564564 }
565- $ count1 = \count ($ rdates );
565+ $ count1 = \is_countable ( $ rdates ) ? \ count ($ rdates ) : 0 ;
566566 $ rdates = \array_unique ($ rdates );
567567 $ count2 = \count ($ rdates );
568568 $ dups = $ count1 - $ count2 ;
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ class ZCiCal
3636 *
3737 * @throws \Exception
3838 */
39- public function __construct (string $ data = '' , int $ maxevents = 1000000 , int $ startevent = 0 )
39+ public function __construct (string $ data = '' , int $ maxevents = 1_000_000 , int $ startevent = 0 )
4040 {
4141
4242 if ('' != $ data )
@@ -288,7 +288,7 @@ public static function formatContent(string $content) : string
288288 */
289289 public function getFirstChild ($ thisnode ) : ?object
290290 {
291- if (\ count ($ thisnode ->child ) > 0 )
291+ if (( \is_countable ( $ thisnode -> child ) ? \ count ($ thisnode ->child ) : 0 ) > 0 )
292292 {
293293 return $ thisnode ->child [0 ];
294294 }
You can’t perform that action at this time.
0 commit comments