Skip to content

Commit

Permalink
docs: Fix code example.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Dec 15, 2020
1 parent a4464cb commit 65769b4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/pages/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ Signature: ``Collection::cache(CacheItemPoolInterface $cache = null);``
$fopen = fopen(__DIR__ . '/vendor/autoload.php', 'r');
$collection = Collection::withResource($fopen)
$collection = Collection::fromResource($fopen)
->cache();
chunk
Expand Down Expand Up @@ -1495,9 +1495,10 @@ Signature: ``Collection::since(callable ...$callbacks);``
.. code-block:: php
// Parse the composer.json of a package and get the require-dev dependencies.
$collection = Collection::withResource(fopen(__DIR__ . '/composer.json', 'rb'))
$collection = Collection::fromResource(fopen(__DIR__ . '/composer.json', 'rb'))
// Group items when EOL character is found.
->split(
Splitable::REMOVE,
static function (string $character): bool {
return "\n" === $character;
}
Expand Down Expand Up @@ -1545,7 +1546,7 @@ Signature: ``Collection::since(callable ...$callbacks);``
// Convert to array.
->all();
print_r($collection);
print_r($collection);
slice
~~~~~
Expand Down

0 comments on commit 65769b4

Please sign in to comment.