Skip to content

Commit 36e47e6

Browse files
committed
Merge pull request bocharsky-bw#15 from visualfanatic/patch-1
A few changes to README.md
2 parents 61a2cae + e41a066 commit 36e47e6

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ There are two available classes with a different behaviour:
1515
## MutableArray
1616

1717
Each functional method operate on the same array and return the same instance
18-
(DO NOT create a new instance) except only few methods starts with `create` prefix.
18+
(**DO NOT** create a new instance) except only few methods starts with `create` prefix.
1919
This way a bit improve performance and provide more convenience usage in OOP way.
2020

2121
> **NOTE:** Check the [CreateClone](#createclone) section if you want to operate on new instance NOT on same instance.
2222
2323
## ImmutableArray
2424

2525
Each functional method operate on the same array but not modified it.
26-
Instead of this it return a new object (create a new instance)
26+
Instead of this it return a new object (create a new instance).
2727
This way a bit disimprove performance but give you the behaviour
28-
seems like most of built-in PHP functions that returns a new array (DO NOT modified input one).
28+
seems like most of built-in PHP functions that returns a new array (**DO NOT** modified input one).
2929

3030
> **NOTE:** If you don't need the first instance you operates on, you can override it manually:
3131
@@ -140,9 +140,9 @@ use Arrayzy\ImmutableArray as ImArr; // MuArr and ImArr is the arbitrary aliases
140140
Create a new empty object with the `new` statement using declared arbitrary namespace aliases above:
141141

142142
``` php
143-
$muArr = new MuArr; // Create new instance of MutableArray by namespace alias
143+
$a = new MuArr; // Create new instance of MutableArray by namespace alias
144144
// or
145-
$imArr = new ImArr; // Create new instance of ImmutableArray by namespace alias
145+
$a = new ImArr; // Create new instance of ImmutableArray by namespace alias
146146
```
147147

148148
or with default values, passed an array to the constructor:
@@ -416,6 +416,7 @@ $a = A::create(['a', 'b', 'c']);
416416
$a->find(function($value, $key) {
417417
return 'b' == $value && 0 < $key;
418418
}); // 'b'
419+
```
419420

420421
### first
421422

@@ -749,7 +750,7 @@ $a->toArray(); // [0 => 'a', 1 => 'b', 3 => 'c']
749750
### unshift
750751

751752
``` php
752-
$a = A::create([('a', 'b']);
753+
$a = A::create(['a', 'b']);
753754
$a->unshift('y', 'z');
754755
$a->toArray(); // [0 => 'y', 1 => 'z', 2 => 'a', 3 => 'b']
755756
```
@@ -760,7 +761,7 @@ $a->toArray(); // [0 => 'y', 1 => 'z', 2 => 'a', 3 => 'b']
760761

761762
``` php
762763
$a = A::create(['a', 'b', 'c']);
763-
$a->walk(function(&$value, $key) { //
764+
$a->walk(function(&$value, $key) {
764765
$key++; // the $key variable passed by value, (original value will not modified)
765766
$value = $value . $key; // the $value variable passed by reference (modify original value)
766767
});

0 commit comments

Comments
 (0)