Skip to content

Commit

Permalink
Update documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jun 26, 2020
1 parent 4498857 commit 92f8c20
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/pages/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,22 @@ Signature: ``Collection::with($data = [], ...$parameters);``

.. code-block:: php
// With an iterable
$collection = Collection::with(['a', 'b']);
// With a string
$collection = Collection::with('string');
$collection = Collection::with($fibonacci, 0, 1);
$fileReader = static function ($file) {
yield from new SplFileObject($file);
};
$collection = Collection::with($fibonacci, __DIR__ . '/vendor/autoload.php');
// With a callback
$collection = Collection::with($fileReader, __DIR__ . '/vendor/autoload.php');
// With a resource/stream
$collection = Collection::with(fopen( __DIR__ . '/vendor/autoload.php', 'r'));
Methods (operations)
--------------------
Expand Down

0 comments on commit 92f8c20

Please sign in to comment.