diff --git a/src/DataCollector/CacheDataCollector.php b/src/DataCollector/CacheDataCollector.php index 54b1148..3302c4c 100644 --- a/src/DataCollector/CacheDataCollector.php +++ b/src/DataCollector/CacheDataCollector.php @@ -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; } diff --git a/src/DataCollector/CacheProxy.php b/src/DataCollector/CacheProxyInterface.php similarity index 94% rename from src/DataCollector/CacheProxy.php rename to src/DataCollector/CacheProxyInterface.php index 759f5e8..c592ec3 100644 --- a/src/DataCollector/CacheProxy.php +++ b/src/DataCollector/CacheProxyInterface.php @@ -16,7 +16,7 @@ * * @author Tobias Nyholm */ -interface CacheProxy +interface CacheProxyInterface { public function __getCalls(); diff --git a/src/DataCollector/DecoratingFactory.php b/src/DataCollector/DecoratingFactory.php index dfccc96..781f39c 100644 --- a/src/DataCollector/DecoratingFactory.php +++ b/src/DataCollector/DecoratingFactory.php @@ -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) { diff --git a/src/Resources/proxy/template.php b/src/Resources/proxy/template.php index 91b69fd..e350c8c 100644 --- a/src/Resources/proxy/template.php +++ b/src/Resources/proxy/template.php @@ -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 = []; @@ -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; }