File tree 2 files changed +20
-0
lines changed
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -553,6 +553,16 @@ public function isEmpty()
553
553
return empty ($ this ->items );
554
554
}
555
555
556
+ /**
557
+ * Determine if the collection contains a single item.
558
+ *
559
+ * @return bool
560
+ */
561
+ public function containsOneItem ()
562
+ {
563
+ return $ this ->count () === 1 ;
564
+ }
565
+
556
566
/**
557
567
* Join all items from the collection using a string. The final items can use a separate glue string.
558
568
*
Original file line number Diff line number Diff line change @@ -556,6 +556,16 @@ public function isEmpty()
556
556
return ! $ this ->getIterator ()->valid ();
557
557
}
558
558
559
+ /**
560
+ * Determine if the collection contains a single item.
561
+ *
562
+ * @return bool
563
+ */
564
+ public function containsOneItem ()
565
+ {
566
+ return $ this ->take (2 )->count () === 1 ;
567
+ }
568
+
559
569
/**
560
570
* Join all items from the collection using a string. The final items can use a separate glue string.
561
571
*
You can’t perform that action at this time.
0 commit comments