for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* User: LAHAXE Arnaud
* Date: 05/11/2015
* Time: 12:40
* FileName : User.php
* Project : profiler
*/
namespace Ndrx\Profiler\Collectors\Data;
use Ndrx\Profiler\Collectors\Contracts\StreamCollectorInterface;
use Ndrx\Profiler\Collectors\StreamCollector;
use Ndrx\Profiler\JsonPatch;
use Ndrx\Profiler\Renderer\BarRenderableInterface;
use Ndrx\Profiler\Renderer\RendererInterface;
abstract class Cache extends StreamCollector implements StreamCollectorInterface, BarRenderableInterface
{
* Write data in the datasource and clean current buffer
* @return mixed
public function stream()
$patch = $this->jsonPatch->generate($this->getPath(), JsonPatch::ACTION_ADD, $this->data, true);
$this->dataSource->save($this->process, [$patch]);
$this->data = [];
}
public function getDataFields()
return [
'action', 'value', 'lifetime', 'key', 'result', 'success'
];
* The path in the final json
* @example
* path /aa/bb
* will be transformed to
* {
* aa : {
* bb: <VALUE OF RESOLVE>
* }
public function getPath()
return 'cache';
* @return RendererInterface
*
* @throws \RuntimeException
public function getRenderer()
return new \Ndrx\Profiler\Renderer\Html\Data\Cache();