Skip to content

Commit

Permalink
Replaced deprecated method from PhpGenerator.
Browse files Browse the repository at this point in the history
  • Loading branch information
KacerCZ committed Mar 10, 2023
1 parent 4c38efa commit fffda43
Showing 1 changed file with 4 additions and 3 deletions.
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 fffda43

Please sign in to comment.