Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/DataCollector/CacheDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
class CacheDataCollector extends DataCollector
{
/**
* @type CacheProxy[]
* @type CacheProxyInterface[]
*/
private $instances = [];

/**
* @param string $name
* @param CacheProxy $instance
* @param string $name
* @param CacheProxyInterface $instance
*/
public function addInstance($name, CacheProxy $instance)
public function addInstance($name, CacheProxyInterface $instance)
{
$this->instances[$name] = $instance;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @author Tobias Nyholm <[email protected]>
*/
interface CacheProxy
interface CacheProxyInterface
{
public function __getCalls();

Expand Down
6 changes: 3 additions & 3 deletions src/DataCollector/DecoratingFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ public function __construct(ProxyFactory $proxyFactory)
/**
* @param CacheItemPoolInterface $originalObject original class
*
* @return CacheProxy|CacheItemPoolInterface
* @return CacheProxyInterface|CacheItemPoolInterface
*/
public function create($originalObject)
{
$proxyClass = $this->proxyFactory->createProxy(get_class($originalObject));
$rc = new \ReflectionClass($proxyClass);
$pool = $rc->newInstanceWithoutConstructor();
$reflection = new \ReflectionClass($proxyClass);
$pool = $reflection->newInstanceWithoutConstructor();

// Copy properties from original pool to new
foreach (NSA::getProperties($originalObject) as $property) {
Expand Down
12 changes: 6 additions & 6 deletions src/Resources/proxy/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
* with this source code in the file LICENSE.
*/

use Cache\CacheBundle\DataCollector\CacheProxy;
use Cache\CacheBundle\DataCollector\CacheProxyInterface;
use Cache\CacheBundle\DataCollector\TraceableAdapterEvent;
use Psr\Cache\CacheItemInterface;

class __TPL_CLASS__ extends __TPL_EXTENDS__ implements CacheProxy
class __TPL_CLASS__ extends __TPL_EXTENDS__ implements CacheProxyInterface
{
private $__name;
private $__calls = [];
Expand Down Expand Up @@ -168,10 +168,10 @@ public function __setName($name)

private function start($name, $argument = null)
{
$this->__calls[] = $event = new TraceableAdapterEvent();
$event->name = $name;
$event->argument = $argument;
$event->start = microtime(true);
$this->__calls[] = $event = new TraceableAdapterEvent();
$event->name = $name;
$event->argument = $argument;
$event->start = microtime(true);

return $event;
}
Expand Down