Skip to content

Commit 90dd852

Browse files
committed
Corrected README to new name of Dots class
1 parent 61c063c commit 90dd852

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ as if it were an `array`.
1414
There are three ways to create a `Dots`:
1515
```php
1616
// Create an empty dot array
17-
$dot = new \MadeSimple\Dots();
17+
$dots = new \MadeSimple\Dots();
1818

1919
// Create a dot array with a pre-existing array
20-
$dot = new \MadeSimple\Dots($array);
20+
$dots = new \MadeSimple\Dots($array);
2121

2222
// Create a dot array with
23-
$dot = new \MadeSimple\Dots([
23+
$dots = new \MadeSimple\Dots([
2424
'address' => [
2525
'houseNo' => '123',
2626
'street' => 'Fake St',
@@ -39,30 +39,30 @@ in the following ways:
3939
```php
4040
// Set an array after dot array
4141
// Changes will _not_ be reflected in the original array
42-
$dot->setArray($array);
42+
$dots->setArray($array);
4343

4444
// Set an array as a reference
4545
// Changes will be reflected in the original array
46-
$dot->setReference($array);
46+
$dots->setReference($array);
4747
```
4848

4949
Basic usage of `Dots`:
5050
```php
5151
// Get a value using dot notation:
52-
echo "Post Code: ", $dot['address.postCode'], PHP_EOL;
52+
echo "Post Code: ", $dots['address.postCode'], PHP_EOL;
5353

5454
// Set a value using dot notation:
55-
$dot['address.postCode'] = 'EF45 6GH';
56-
echo "Post Code: ", $dot['address.postCode'], PHP_EOL;
55+
$dots['address.postCode'] = 'EF45 6GH';
56+
echo "Post Code: ", $dots['address.postCode'], PHP_EOL;
5757

5858
// Remove a value using dot notation:
59-
unset($dot['address.postCode']);
60-
echo "Exists: ", (isset($dot['address.postCode']) ? 'yes' : 'no'), PHP_EOL;
59+
unset($dots['address.postCode']);
60+
echo "Exists: ", (isset($dots['address.postCode']) ? 'yes' : 'no'), PHP_EOL;
6161

6262
// Add a value using dot notation:
63-
$dot['address.postCode'] = 'IJ78 9KL';
64-
echo "Post Code: ", $dot['address.postCode'], PHP_EOL;
63+
$dots['address.postCode'] = 'IJ78 9KL';
64+
echo "Post Code: ", $dots['address.postCode'], PHP_EOL;
6565

6666
// Access nth element in an sub array
67-
echo "Comment: ", $dot['comments.1'], PHP_EOL;
67+
echo "Comment: ", $dots['comments.1'], PHP_EOL;
6868
```

0 commit comments

Comments
 (0)