Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/Utils/ArrayWalker/ArrayWalkerTrait.php
  • Loading branch information
Sofiosko committed Sep 6, 2019
2 parents c250915 + 39f5a62 commit 737cfd2
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/init.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
require_once __DIR__ . '/Utils/ArrayWalker/ArrayWalker.php';
require_once __DIR__ . '/Utils/ArrayWalker/ArrayWalkerTrait.php';
require_once __DIR__ . '/Utils/Timer/Timer.php';
require_once __DIR__ . '/Utils/Timer/TimedItem.php';
require_once __DIR__ . '/Utils/WebLoader/WebLoader.php';
Expand All @@ -10,4 +11,26 @@
require_once __DIR__ . '/Utils/Subjects/Helpers.php';

// install vendor in this package for testing
require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/../vendor/autoload.php';

class ExampleDataStorage
{
use \BiteIT\Utils\ArrayWalkerTrait;

protected $data = [
'level-1' => [
'value' => true,
'level-2' => [
'value' => true,
'level-3' => [
'value' => true
]
]
]
];

public function getDataContainerName()
{
return 'data';
}
}
8 changes: 8 additions & 0 deletions tests/test-walker-trait.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
require_once __DIR__ . '/../src/init.php';

$storage = new ExampleDataStorage();

echo '<pre>';
var_dump($storage->getData('level-1'));
echo '</pre>';

0 comments on commit 737cfd2

Please sign in to comment.