function AbstractCollection::add
Throws
InvalidArgumentException if $element is of the wrong type.
Overrides CollectionInterface::add
2 calls to AbstractCollection::add()
- AbstractSet::add in vendor/
ramsey/ collection/ src/ AbstractSet.php - Ensures that this collection contains the specified element (optional operation).
- AbstractSet::add in vendor/
ramsey/ collection/ src/ AbstractSet.php - Ensures that this collection contains the specified element (optional operation).
1 method overrides AbstractCollection::add()
- AbstractSet::add in vendor/
ramsey/ collection/ src/ AbstractSet.php - Ensures that this collection contains the specified element (optional operation).
File
-
vendor/
ramsey/ collection/ src/ AbstractCollection.php, line 60
Class
- AbstractCollection
- This class provides a basic implementation of `CollectionInterface`, to minimize the effort required to implement this interface
Namespace
Ramsey\CollectionCode
public function add(mixed $element) : bool {
$this[] = $element;
return true;
}