diff options
Diffstat (limited to 'vendor/ramsey/collection/src/Collection.php')
-rw-r--r-- | vendor/ramsey/collection/src/Collection.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/vendor/ramsey/collection/src/Collection.php b/vendor/ramsey/collection/src/Collection.php index 44d26bf2e..1299c12c2 100644 --- a/vendor/ramsey/collection/src/Collection.php +++ b/vendor/ramsey/collection/src/Collection.php @@ -76,15 +76,26 @@ namespace Ramsey\Collection; class Collection extends AbstractCollection { /** + * The type of elements stored in this collection. + * + * A collection's type is immutable once it is set. For this reason, this + * property is set private. + * + * @var string + */ + private $collectionType; + + /** * Constructs a collection object of the specified type, optionally with the * specified data. * - * @param string $collectionType The type or class name associated with this + * @param string $collectionType The type (FQCN) associated with this * collection. * @param array<array-key, T> $data The initial items to store in the collection. */ - public function __construct(private readonly string $collectionType, array $data = []) + public function __construct(string $collectionType, array $data = []) { + $this->collectionType = $collectionType; parent::__construct($data); } |