Skip to content

Commit db7eb5d

Browse files
authored
Insight fixes (#77)
* Insight fixes * Applied changes from StyleCI
1 parent 333e10b commit db7eb5d

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

Diff for: src/DataCollector/CacheDataCollector.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
class CacheDataCollector extends DataCollector
2626
{
2727
/**
28-
* @type CacheProxy[]
28+
* @type CacheProxyInterface[]
2929
*/
3030
private $instances = [];
3131

3232
/**
33-
* @param string $name
34-
* @param CacheProxy $instance
33+
* @param string $name
34+
* @param CacheProxyInterface $instance
3535
*/
36-
public function addInstance($name, CacheProxy $instance)
36+
public function addInstance($name, CacheProxyInterface $instance)
3737
{
3838
$this->instances[$name] = $instance;
3939
}

Diff for: src/DataCollector/CacheProxy.php renamed to src/DataCollector/CacheProxyInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @author Tobias Nyholm <[email protected]>
1818
*/
19-
interface CacheProxy
19+
interface CacheProxyInterface
2020
{
2121
public function __getCalls();
2222

Diff for: src/DataCollector/DecoratingFactory.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ public function __construct(ProxyFactory $proxyFactory)
3737
/**
3838
* @param CacheItemPoolInterface $originalObject original class
3939
*
40-
* @return CacheProxy|CacheItemPoolInterface
40+
* @return CacheProxyInterface|CacheItemPoolInterface
4141
*/
4242
public function create($originalObject)
4343
{
4444
$proxyClass = $this->proxyFactory->createProxy(get_class($originalObject));
45-
$rc = new \ReflectionClass($proxyClass);
46-
$pool = $rc->newInstanceWithoutConstructor();
45+
$reflection = new \ReflectionClass($proxyClass);
46+
$pool = $reflection->newInstanceWithoutConstructor();
4747

4848
// Copy properties from original pool to new
4949
foreach (NSA::getProperties($originalObject) as $property) {

Diff for: src/Resources/proxy/template.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
* with this source code in the file LICENSE.
1010
*/
1111

12-
use Cache\CacheBundle\DataCollector\CacheProxy;
12+
use Cache\CacheBundle\DataCollector\CacheProxyInterface;
1313
use Cache\CacheBundle\DataCollector\TraceableAdapterEvent;
1414
use Psr\Cache\CacheItemInterface;
1515

16-
class __TPL_CLASS__ extends __TPL_EXTENDS__ implements CacheProxy
16+
class __TPL_CLASS__ extends __TPL_EXTENDS__ implements CacheProxyInterface
1717
{
1818
private $__name;
1919
private $__calls = [];
@@ -168,10 +168,10 @@ public function __setName($name)
168168

169169
private function start($name, $argument = null)
170170
{
171-
$this->__calls[] = $event = new TraceableAdapterEvent();
172-
$event->name = $name;
173-
$event->argument = $argument;
174-
$event->start = microtime(true);
171+
$this->__calls[] = $event = new TraceableAdapterEvent();
172+
$event->name = $name;
173+
$event->argument = $argument;
174+
$event->start = microtime(true);
175175

176176
return $event;
177177
}

0 commit comments

Comments
 (0)