Skip to content

Commit 6173cb2

Browse files
committed
Re-added JSONPath::data() until 0.8.0
1 parent fe256a9 commit 6173cb2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/JSONPath.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
use function next;
2525
use function reset;
2626

27+
use const E_USER_DEPRECATED;
28+
2729
class JSONPath implements ArrayAccess, Iterator, JsonSerializable, Countable
2830
{
2931
public const ALLOW_MAGIC = true;
@@ -175,6 +177,19 @@ public function getData(): array
175177
return $this->data;
176178
}
177179

180+
/**
181+
* @deprecated Please use getData() instead
182+
*/
183+
public function data(): array
184+
{
185+
trigger_error(
186+
'Calling JSONPath::data() is deprecated, please use JSONPath::getData() instead.',
187+
E_USER_DEPRECATED
188+
);
189+
190+
return $this->getData();
191+
}
192+
178193
/**
179194
* @param mixed $key
180195
* @return mixed|null

0 commit comments

Comments
 (0)