@@ -24,31 +24,31 @@ composer require linna/typed-array
2424use Linna\TypedArray;
2525
2626//correct, only int passed to constructor.
27- $array = new TypedArray('int', [1, 2, 3, 4]);
27+ $intArray = new TypedArray('int', [1, 2, 3, 4]);
2828
2929//correct, int assigned
30- $array [] = 5;
30+ $intArray [] = 5;
3131
3232//throw InvalidArgumentException, string assigned.
33- $array [] = 'a';
33+ $intArray [] = 'a';
3434
3535//throw InvalidArgumentException, mixed array passed to constructor.
36- $array = new TypedArray('int', [1, 'a', 3, 4]);
36+ $otherIntArray = new TypedArray('int', [1, 'a', 3, 4]);
3737
3838//correct, only Foo class instances passed to constructor.
39- $array = new TypedArray(Foo::class, [
39+ $fooArray = new TypedArray(Foo::class, [
4040 new Foo(),
4141 new Foo()
4242]);
4343
4444//correct, Foo() instance assigned.
45- $array [] = new Foo();
45+ $fooArray [] = new Foo();
4646
4747//throw InvalidArgumentException, Bar() instance assigned.
48- $array [] = new Bar();
48+ $fooArray [] = new Bar();
4949
5050//throw InvalidArgumentException, mixed array of instances passed to constructor.
51- $array = new TypedArray(Foo::class, [
51+ $otherFooArray = new TypedArray(Foo::class, [
5252 new Foo(),
5353 new Bar()
5454]);
0 commit comments