Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix imports in README #111

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ for PHP >=7.0. See [TL;DR](#tl-dr). No dependencies in production except optiona
```diff
<?php

use \JsonMachine\Items;
use JsonMachine\Items;

// this often causes Allowed Memory Size Exhausted
- $users = json_decode(file_get_contents('500MB-users.json'));
Expand Down Expand Up @@ -107,7 +107,7 @@ It can be parsed this way:
```php
<?php

use \JsonMachine\Items;
use JsonMachine\Items;

$fruits = Items::fromFile('fruits.json');

Expand Down Expand Up @@ -151,7 +151,7 @@ use JSON Pointer `/results` as `pointer` option:
```php
<?php

use \JsonMachine\Items;
use JsonMachine\Items;

$fruits = Items::fromFile('fruits.json', ['pointer' => '/results']);
foreach ($fruits as $name => $data) {
Expand Down Expand Up @@ -195,7 +195,7 @@ To iterate over all colors of the fruits, use the JSON Pointer `"/results/-/colo
```php
<?php

use \JsonMachine\Items;
use JsonMachine\Items;

$fruits = Items::fromFile('fruitsArray.json', ['pointer' => '/results/-/color']);

Expand Down Expand Up @@ -234,7 +234,7 @@ Get the scalar value of `lastModified` key like this:
```php
<?php

use \JsonMachine\Items;
use JsonMachine\Items;

$fruits = Items::fromFile('fruits.json', ['pointer' => '/lastModified']);
foreach ($fruits as $key => $value) {
Expand All @@ -251,7 +251,7 @@ The obvious shortcut is:
```php
<?php

use \JsonMachine\Items;
use JsonMachine\Items;

$fruits = Items::fromFile('fruits.json', ['pointer' => '/lastModified']);
$lastModified = iterator_to_array($fruits)['lastModified'];
Expand Down Expand Up @@ -293,7 +293,7 @@ does not matter. The items will be iterated in the order of appearance in the do
```php
<?php

use \JsonMachine\Items;
use JsonMachine\Items;

$fruits = Items::fromFile('fruits.json', [
'pointer' => ['/berries', '/citruses']
Expand Down
Loading