Skip to content

Commit

Permalink
Tweak to SpecificObjectsCollection::makeNewForSpecifiedClassName, sup…
Browse files Browse the repository at this point in the history
…pressed the class_exists check
  • Loading branch information
rotexdegba committed Feb 2, 2020
1 parent d61bd57 commit 71be176
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 5 deletions.
1 change: 0 additions & 1 deletion docs/MethodDescriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3937,7 +3937,6 @@ SpecificObjectsCollection:
Create a new collection that only stores instances of the specified fully qualified class name
or its sub-classes or a new collection that stores any kind of object if no fully qualified
class name was specified (essentially works like ObjectsCollection in the latter case).<br>
A `\VersatileCollections\Exceptions\SpecifiedClassNotFoundException` exception is thrown if **$class_name** is not a class that actually exists.<br>
A `\VersatileCollections\Exceptions\InvalidItemException` exception is thrown if any of the items in **$items** is not an instance of **$class_name** if **$class_name** is not null.<br>

* **$class_name**: fully qualified name of the class whose instances or instances of its sub-classes alone would be stored in the collection.
Expand Down
2 changes: 0 additions & 2 deletions docs/SpecificObjectsCollection.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* only accepts items that are instances of a specified class (if the class name is provided as the first parameter to **SpecificObjectsCollection::makeNewForSpecifiedClassName**) and the specified class' sub-classes
* or stores any kind of object (i.e. works exactly like **ObjectsCollection** if no class name or null is provided as the first parameter to **SpecificObjectsCollection::makeNewForSpecifiedClassName**)

> NOTE: If the specified class does not exist (i.e. **class_exists** returns false for the specified class), then the **\VersatileCollections\Exceptions\SpecifiedClassNotFoundException** will be thrown
> NOTE: **SpecificObjectsCollection** is a final class and was never intended to be extensible. It has a **protected** constructor by design so that its instances cannot be created via the use of the **new** keyword,
instead its instances can only be created by calling either
> * **SpecificObjectsCollection::makeNewForSpecifiedClassName(?string $class_name=null, array $items =[], bool $preserve_keys=true)**
Expand Down
2 changes: 0 additions & 2 deletions src/SpecificObjectsCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ protected function __construct(object ...$objects) {
*
* @title: Create a new collection that only stores instances of the specified fully qualified class name or its sub-classes or a new collection that stores any kind of object if no fully qualified class name was specified (Essentially works like ObjectsCollection in the latter case).
*
* @throws \VersatileCollections\Exceptions\SpecifiedClassNotFoundException
*
*/
public static function makeNewForSpecifiedClassName(?string $class_name=null, array $items =[], bool $preserve_keys=true): \VersatileCollections\StrictlyTypedCollectionInterface {

Expand Down

0 comments on commit 71be176

Please sign in to comment.