Skip to content

Commit

Permalink
don't pass path
Browse files Browse the repository at this point in the history
  • Loading branch information
cancan101 committed Nov 22, 2024
1 parent ab8ad90 commit 1298362
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/DataSource/Interpreter/JsonFileInterpreter.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected function loadData(string $path): array
$data = json_decode($this->prepareContent($content), true);

if (!empty($this->path)) {
return $this->getValueFromPath($this->path, $data);
return $this->getValueFromPath($data);
}

return $data;
Expand Down Expand Up @@ -144,8 +144,8 @@ public function previewData(string $path, int $recordNumber = 0, array $mappedCo
/**
* Returns a value from the specified path in a nested array `$data`.
*/
private function getValueFromPath(string $path, array $data): mixed
private function getValueFromPath(array $data): mixed
{
return JmesPath\Env::search($path, $data);
return JmesPath\Env::search($this->path, $data);
}
}

0 comments on commit 1298362

Please sign in to comment.