mirror of
https://github.com/maximebf/php-debugbar.git
synced 2025-01-17 13:28:35 +01:00
36 lines
622 B
PHP
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();
|
|
}
|
|
}
|