Skip to content

Commit

Permalink
Removed nette/reflection dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
KacerCZ committed Nov 21, 2019
1 parent f004495 commit 5d6028f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"nette/di": "~2.4.10 || ~3.0",
"nette/caching": "~3.0",
"nette/http": "~2.4.7 || ~3.0",
"nette/utils": "~2.5 || ~3.0",
"nette/reflection": "^2.4"
"nette/utils": "~2.5 || ~3.0"
},
"suggest": {
"ext-redis": "The php redis extension https://github.com/nicolasff/phpredis/ is required for connecting to redis server"
Expand Down
5 changes: 2 additions & 3 deletions tests/KdybyTests/Redis/AbstractRedisTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use Closure;
use Kdyby\Redis\RedisClient;
use Nette\Reflection\ClassType;
use Nette\Utils\FileSystem;
use ReflectionClass;
use ReflectionFunctionAbstract;
Expand Down Expand Up @@ -91,10 +90,10 @@ protected function threadStress(Closure $closure, int $repeat = 100, int $thread
FileSystem::createDir($dir = \dirname($scriptFile));

$extractor = new ClosureExtractor($closure);
\file_put_contents($scriptFile, $extractor->buildScript(ClassType::from($this), $repeat));
$testRefl = new ReflectionClass($this);
\file_put_contents($scriptFile, $extractor->buildScript($testRefl, $repeat));
@\chmod($scriptFile, 0755);

$testRefl = new ReflectionClass($this);
$collector = new ResultsCollector(\dirname($testRefl->getFileName()) . '/output', $runTest['args'][0]);

// todo: fix for hhvm
Expand Down
4 changes: 2 additions & 2 deletions tests/KdybyTests/Redis/ClosureExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ class ClosureExtractor
use \Nette\SmartObject;

/**
* @var \Nette\Reflection\GlobalFunction
* @var \ReflectionFunction
*/
private $closure;

public function __construct(\Closure $closure)
{
$this->closure = new \Nette\Reflection\GlobalFunction($closure);
$this->closure = new \ReflectionFunction($closure);
}

public function buildScript(
Expand Down

0 comments on commit 5d6028f

Please sign in to comment.