Go\Proxy\ClassProxy::getConstructorBody PHP Method

getConstructorBody() private method

Returns constructor code
private getConstructorBody ( ReflectionMethod $constructor = null, boolean $isCallParent = false ) : string
$constructor ReflectionMethod Constructor reflection
$isCallParent boolean Is there is a need to call parent code
return string
    private function getConstructorBody(ReflectionMethod $constructor = null, $isCallParent = false)
    {
        $assocProperties = [];
        $listProperties = [];
        foreach ($this->interceptedProperties as $propertyName) {
            $assocProperties[] = "'{$propertyName}' => &\$this->{$propertyName}";
            $listProperties[] = "\$this->{$propertyName}";
        }
        $assocProperties = $this->indent(join(',' . PHP_EOL, $assocProperties));
        $listProperties = $this->indent(join(',' . PHP_EOL, $listProperties));
        if (isset($this->methodsCode['__construct'])) {
            $parentCall = $this->getJoinpointInvocationBody($constructor);
        } elseif ($isCallParent) {
            $parentCall = '\\call_user_func_array(["parent", __FUNCTION__], \\func_get_args());';
        } else {
            $parentCall = '';
        }
        return <<<CTOR
\$this->__properties = array(
{$assocProperties}
);
unset(
{$listProperties}
);
{$parentCall}
CTOR;
    }