Skip to content

Commit 735b329

Browse files
committed
Fix namespace import
1 parent 7962aaa commit 735b329

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ composer require rexlabs/array-object
2626
```php
2727
<?php
2828
require 'vendor/autoload.php';
29-
use Rexlabs\ArrayObject;
29+
use Rexlabs\ArrayObject\ArrayObject;
3030

3131
// Initialise from an Array
3232
$obj = ArrayObject::fromArray([...]);
@@ -43,7 +43,6 @@ $json = $obj->toJson();
4343

4444
The examples below are based on the follow input data.
4545

46-
4746
```json
4847
{
4948
"books": [
@@ -67,6 +66,7 @@ The examples below are based on the follow input data.
6766
```php
6867
$obj->books; // Instance of ArrayObject
6968
$obj->books->pluckArray('author'); // array [ 'George Orwell', 'Jane Austen' ]
69+
$obj->pluckArray('books.author'); // array [ 'George Orwell', 'Jane Austen' ]
7070
$obj->books->count(); // 2
7171
$obj->books->isCollection(); // true
7272
$obj->books[0]; // Instance of ArrayObject
@@ -81,14 +81,16 @@ Note: All of the methods gracefully handle treating an individual item as an arr
8181
The `get()` method allows you to fetch the value of a property, and receive a default if the value does not exist. It also supports depth which is indicated with a `.`:
8282

8383
```php
84+
$obj->get('books.0'); // ArrayObject
8485
$obj->get('books.0.title'); // "1984"
8586
$obj->get('books.1.title'); // "Pride and Prejudice"
86-
$obj->get('books.0.missing', 'Defult value'); // "Default value"
87+
$obj->get('books.0.missing', 'Default value'); // "Default value"
8788
```
8889

8990
You can also fetch the properties using object property syntax (we overload `__get()` to achieve this):
9091

9192
```php
93+
$obj->books[0]; // ArrayObject
9294
$obj->books[0]->title; // "1984"
9395
$obj->books[1]->title; // "Pride and Prejudice"
9496
$obj->books[0]->missing; // throws InvalidPropertyException

src/ArrayObject.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
namespace Rexlabs\ArrayObject;
33

44
use ArrayIterator;
5-
use BkvFoundry\UtilityBelt\ArrayUtility;
6-
use BkvFoundry\UtilityBelt\CollectionUtility;
5+
use Rexlabs\UtilityBelt\ArrayUtility;
6+
use Rexlabs\UtilityBelt\CollectionUtility;
77
use Rexlabs\ArrayObject\Exceptions\InvalidOffsetException;
88
use Rexlabs\ArrayObject\Exceptions\InvalidPropertyException;
99
use Rexlabs\ArrayObject\Exceptions\JsonDecodeException;

0 commit comments

Comments
 (0)