Adds the constructor for a frozen container.
string
private function addFrozenConstructor() {
$code = <<<EOF
/**
* Constructor.
*/
public function __construct()
{
EOF;
if ($this->container
->getParameterBag()
->all()) {
$code .= "\n \$this->parameters = \$this->getDefaultParameters();\n";
}
$code .= <<<EOF
\$this->services =
\$this->scopedServices =
\$this->scopeStacks = array();
\$this->set('service_container', \$this);
EOF;
$code .= "\n";
if (count($scopes = $this->container
->getScopes()) > 0) {
$code .= " \$this->scopes = " . $this
->dumpValue($scopes) . ";\n";
$code .= " \$this->scopeChildren = " . $this
->dumpValue($this->container
->getScopeChildren()) . ";\n";
}
else {
$code .= " \$this->scopes = array();\n";
$code .= " \$this->scopeChildren = array();\n";
}
$code .= <<<EOF
}
EOF;
return $code;
}