Skip to content

Commit

Permalink
Merge pull request #126 from KacerCZ/nette-utils-4.0
Browse files Browse the repository at this point in the history
Allow use of nette/utils 4.0
  • Loading branch information
Spamercz authored Mar 14, 2023
2 parents 587bb97 + 0bd23fd commit 1a2412b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
"nette/di": "~3.0",
"nette/caching": "~3.1",
"nette/http": "~3.0",
"nette/utils": "~3.0"
"nette/utils": "~3.0 || ^4.0"
},
"suggest": {
"ext-redis": "The php redis extension https://github.com/nicolasff/phpredis/ is required for connecting to redis server"
},
"require-dev": {
"nette/bootstrap": "~3.0",
"nette/deprecated": "~3.0",
"nette/php-generator": "~3.3",
"nette/php-generator": "~3.3 || ^4.0",
"tracy/tracy": "~2.4",
"slevomat/coding-standard": "dev-master",
"nette/tester": "^2.3.1",
Expand Down
7 changes: 4 additions & 3 deletions tests/KdybyTests/Redis/ClosureExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ public function buildScript(
$code .= "\n\nnamespace " . $class->getNamespaceName() . ";\n\n";
$code .= 'use ' . \implode(";\n" . 'use ', $uses->parse()) . ";\n\n";

$dumper = new \Nette\PhpGenerator\Dumper();
// bootstrap
$code .= \Nette\PhpGenerator\Helpers::formatArgs('require_once ?;', [__DIR__ . '/../bootstrap.php']) . "\n";
$code .= $dumper->format('require_once ?;', __DIR__ . '/../bootstrap.php') . "\n";
$code .= '\Tester\Environment::$checkAssertions = FALSE;' . "\n";
$code .= \Nette\PhpGenerator\Helpers::formatArgs('\Tracy\Debugger::$logDirectory = ?;', [TEMP_DIR]) . "\n\n\n";
$code .= $dumper->format('\Tracy\Debugger::$logDirectory = ?;', TEMP_DIR) . "\n\n\n";

// script
$code .= \Nette\PhpGenerator\Helpers::formatArgs('extract(?);', [$this->closure->getStaticVariables()]) . "\n\n";
$code .= $dumper->format('extract(?);', $this->closure->getStaticVariables()) . "\n\n";
$code .= $codeParser->parse() . "\n\n\n";

return $code;
Expand Down

0 comments on commit 1a2412b

Please sign in to comment.