File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 21
21
class TypedArray extends ArrayObject
22
22
{
23
23
/**
24
- * @var array $allowedTypes Types supported by class
24
+ * @var array Types supported by class
25
25
*/
26
26
protected $ allowedTypes = [
27
27
'array ' ,
@@ -34,15 +34,15 @@ class TypedArray extends ArrayObject
34
34
];
35
35
36
36
/**
37
- * @var string $type Current type for array
37
+ * @var string Current type for array
38
38
*/
39
39
protected $ type = '' ;
40
40
41
41
/**
42
42
* Contructor.
43
43
*
44
44
* @param string $type
45
- * @param array $array
45
+ * @param array $array
46
46
* @throws InvalidArgumentException If type is not supported
47
47
* @throws TypeError If elements of passed with $array
48
48
* are not of the configured type
@@ -51,7 +51,7 @@ public function __construct(string $type, array $array = [])
51
51
{
52
52
//single class, multi type support :)
53
53
//if (!isset($this->allowedTypes[$type])){
54
- if (!in_array ($ type , $ this ->allowedTypes )){
54
+ if (!in_array ($ type , $ this ->allowedTypes )) {
55
55
throw new InvalidArgumentException ($ type .' type passed to ' .__CLASS__ .' not supported ' );
56
56
}
57
57
@@ -84,6 +84,7 @@ public function offsetSet($index, $newval)
84
84
85
85
if ($ is_ ($ newval )) {
86
86
parent ::offsetSet ($ index , $ newval );
87
+
87
88
return ;
88
89
}
89
90
throw new TypeError ('Elements passed to ' .__CLASS__ .' must be of the type ' .$ this ->type );
You can’t perform that action at this time.
0 commit comments