<?php

namespace Phug\Renderer\Adapter;

use Phug\Formatter\Util\PhpUnwrapString;
use Phug\Renderer\AbstractAdapter;

/**
 * Renderer using `eval()` PHP language construct.
 *
 * Note: this is not more risky than other evaluation ways. Every adapter will execute the code of the Pug
 * templates (inside code statements and expressions). To be safe, you should not render uncontrolled templates
 * unless your environment is a restricted sandbox.
 */
class EvalAdapter extends AbstractAdapter
{
    public function display($__pug_php, array $__pug_parameters)
    {
        $this->execute(function () use ($__pug_php, &$__pug_parameters) {
            extract($__pug_parameters);
            eval(PhpUnwrapString::withoutOpenTag($__pug_php));
        }, $__pug_parameters);
    }
}

<?php

namespace Phug\Renderer\Adapter;

use Phug\Renderer\AbstractAdapter;

/**
 * Renderer using `eval()` PHP language construct.
 *
 * Note: this is not more risky than other evaluation ways. Every adapter will execute the code of the Pug
 * templates (inside code statements and expressions). To be safe, you should not render uncontrolled templates
 * unless your environment is a restricted sandbox.
 */
class EvalAdapter extends AbstractAdapter
{
    public function display($__pug_php, array $__pug_parameters)
    {
        $this->execute(function () use ($__pug_php, &$__pug_parameters) {
            extract($__pug_parameters);
            eval('?>'.$__pug_php);
        }, $__pug_parameters);
    }
}

Revert PhpUnwrapString dependency in the renderer
Revert PhpUnwrapString dependency in the renderer

split: 4f00d56ba136b790c387e99555fd8a0a985ae153
