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(), '');
}
}