Skip to content

Commit 507c42e

Browse files
committed
Change getData() so that it can be mixed instead of array
The constructor itself allows $data to be mixed and the functions in AccessHelper has various conditional statements to process the data depending on whether it is an array or an implementation of ArrayAccess. However, getData() is explicitly typed to return an array which means any attempts to get the source object after creating a JSONPath of it will cause a TypeError to be raised. Changing getData() to return mixed instead of array will help fix this inconsistency. Signed-off-by: Remy Suen <[email protected]>
1 parent 3a6108a commit 507c42e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/JSONPath.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public function parseTokens(string $expression): array
138138
return $tokens;
139139
}
140140

141-
public function getData(): array
141+
public function getData(): mixed
142142
{
143143
return $this->data;
144144
}

0 commit comments

Comments
 (0)