Skip to content

Commit

Permalink
Documentation in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
rotexdegba committed Dec 1, 2018
1 parent 37b6086 commit d87578b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/CallablesCollections.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ Example Usage:
$collection = new \VersatileCollections\CallablesCollection();

// lines below should produce no exception since we are injecting callables
$collection->item1 = function() {
$collection[] = function() {
return 'boo';
};
$collection->item2 = 'strtolower';
$collection->item3 = [\DateTime::class, 'getLastErrors'];
$collection->item4 = [\DateTime::class, 'createFromFormat'];
$collection[] = 'strtolower';
$collection[] = [\DateTime::class, 'getLastErrors'];
$collection[] = [\DateTime::class, 'createFromFormat'];
```

A couple good use-cases for this type of collection would be for implementing a
Expand Down
10 changes: 10 additions & 0 deletions docs/ObjectsCollections.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ return value of NULL for such calls.
If the called method does not exist in one or more of the objects in the collection,
an exception is thrown.

>NOTE: methods registered to the collection via either **`addMethod`** or
**`addMethodForAllInstances`** having the same name as a method present in the
objects in the collection will be called instead of the one in the objects. For
example, if a method named **`save`** was registered via either **`addMethod`** or
**`addMethodForAllInstances`** on a collection object and that same collection
contains objects that each also have a **`save`** method, when the save method
is called on the collection, the method registered via **`addMethod`** or
**`addMethodForAllInstances`** will be executed instead of the save method
in each object in the collection.

Example Usage:

```php
Expand Down

0 comments on commit d87578b

Please sign in to comment.