Skip to content

Commit

Permalink
Re-added JSONPath::data() until 0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SoftCreatR committed Oct 21, 2020
1 parent fe256a9 commit 6173cb2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/JSONPath.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
use function next;
use function reset;

use const E_USER_DEPRECATED;

class JSONPath implements ArrayAccess, Iterator, JsonSerializable, Countable
{
public const ALLOW_MAGIC = true;
Expand Down Expand Up @@ -175,6 +177,19 @@ public function getData(): array
return $this->data;
}

/**
* @deprecated Please use getData() instead
*/
public function data(): array
{
trigger_error(
'Calling JSONPath::data() is deprecated, please use JSONPath::getData() instead.',
E_USER_DEPRECATED
);

return $this->getData();
}

/**
* @param mixed $key
* @return mixed|null
Expand Down

0 comments on commit 6173cb2

Please sign in to comment.