diff --git a/src/Utils/ArrayWalker/ArrayWalkerTrait.php b/src/Utils/ArrayWalker/ArrayWalkerTrait.php index 3523c5c..5434081 100644 --- a/src/Utils/ArrayWalker/ArrayWalkerTrait.php +++ b/src/Utils/ArrayWalker/ArrayWalkerTrait.php @@ -4,7 +4,6 @@ trait ArrayWalkerTrait { - protected $data = []; protected $walker = null; public function getData($key, $defaultValue = null){ @@ -14,8 +13,8 @@ public function getData($key, $defaultValue = null){ protected function getWalker(){ if(isset($this->walker)) return $this->walker; - return $this->walker = ArrayWalker::create($this->fetchData()); + return $this->walker = ArrayWalker::create($this->getDataForWalker()); } - abstract protected function fetchData(); + abstract protected function getDataForWalker(); } \ No newline at end of file diff --git a/src/init.php b/src/init.php index a54c5c2..89ef739 100644 --- a/src/init.php +++ b/src/init.php @@ -29,8 +29,8 @@ class ExampleDataStorage ] ]; - public function getDataContainerName() + protected function getDataForWalker() { - return 'data'; + return $this->data; } } \ No newline at end of file