Go\Proxy\ClassProxy::addFieldInterceptorsCode PHP Method

addFieldInterceptorsCode() protected method

Add code for intercepting properties
protected addFieldInterceptorsCode ( ReflectionMethod $constructor = null )
$constructor ReflectionMethod Constructor reflection or null
    protected function addFieldInterceptorsCode(ReflectionMethod $constructor = null)
    {
        $this->addTrait(PropertyInterceptionTrait::class);
        $this->isFieldsIntercepted = true;
        if ($constructor) {
            $this->override('__construct', $this->getConstructorBody($constructor, true));
        } else {
            $this->setMethod(ReflectionMethod::IS_PUBLIC, '__construct', false, $this->getConstructorBody(), '');
        }
    }