1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-07-11 03:46:28 +02:00
Files
php-debugbar/tests/DebugBar/Tests/Storage/MockStorage.php
Graham Campbell 0071105c25 CS fixes
2014-01-16 21:41:41 +00:00

36 lines
622 B
PHP

<?php
namespace DebugBar\Tests\Storage;
use DebugBar\Storage\StorageInterface;
class MockStorage implements StorageInterface
{
public $data;
public function __construct(array $data = array())
{
$this->data = $data;
}
public function save($id, $data)
{
$this->data[$id] = $data;
}
public function get($id)
{
return $this->data[$id];
}
public function find(array $filters = array(), $max = 20, $offset = 0)
{
return array_slice($this->data, $offset, $max);
}
public function clear()
{
$this->data = array();
}
}