/**
  * {@inheritDoc}
  */
 public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator)
 {
     CanProxyAssertion::assertClassCanBeProxied($originalClass);
     $interfaces = [VirtualProxyInterface::class];
     $publicProperties = new PublicPropertiesMap(Properties::fromReflectionClass($originalClass));
     if ($originalClass->isInterface()) {
         $interfaces[] = $originalClass->getName();
     } else {
         $classGenerator->setExtendedClass($originalClass->getName());
     }
     $classGenerator->setImplementedInterfaces($interfaces);
     $classGenerator->addPropertyFromGenerator($valueHolder = new ValueHolderProperty());
     $classGenerator->addPropertyFromGenerator($initializer = new InitializerProperty());
     $classGenerator->addPropertyFromGenerator($publicProperties);
     array_map(function (MethodGenerator $generatedMethod) use($originalClass, $classGenerator) {
         ClassGeneratorUtils::addMethodIfNotFinal($originalClass, $classGenerator, $generatedMethod);
     }, array_merge(array_map($this->buildLazyLoadingMethodInterceptor($initializer, $valueHolder), ProxiedMethodsFilter::getProxiedMethods($originalClass)), [new StaticProxyConstructor($initializer, Properties::fromReflectionClass($originalClass)), Constructor::generateMethod($originalClass, $valueHolder), new MagicGet($originalClass, $initializer, $valueHolder, $publicProperties), new MagicSet($originalClass, $initializer, $valueHolder, $publicProperties), new MagicIsset($originalClass, $initializer, $valueHolder, $publicProperties), new MagicUnset($originalClass, $initializer, $valueHolder, $publicProperties), new MagicClone($originalClass, $initializer, $valueHolder), new MagicSleep($originalClass, $initializer, $valueHolder), new MagicWakeup($originalClass), new SetProxyInitializer($initializer), new GetProxyInitializer($initializer), new InitializeProxy($initializer, $valueHolder), new IsProxyInitialized($valueHolder), new GetWrappedValueHolderValue($valueHolder)]));
 }
 /**
  * {@inheritDoc}
  */
 public function generate(ReflectionClass $originalClass, ClassGenerator $classGenerator)
 {
     CanProxyAssertion::assertClassCanBeProxied($originalClass);
     $publicProperties = new PublicPropertiesMap(Properties::fromReflectionClass($originalClass));
     $interfaces = [AccessInterceptorInterface::class, ValueHolderInterface::class];
     if ($originalClass->isInterface()) {
         $interfaces[] = $originalClass->getName();
     } else {
         $classGenerator->setExtendedClass($originalClass->getName());
     }
     $classGenerator->setImplementedInterfaces($interfaces);
     $classGenerator->addPropertyFromGenerator($valueHolder = new ValueHolderProperty());
     $classGenerator->addPropertyFromGenerator($prefixInterceptors = new MethodPrefixInterceptors());
     $classGenerator->addPropertyFromGenerator($suffixInterceptors = new MethodSuffixInterceptors());
     $classGenerator->addPropertyFromGenerator($publicProperties);
     array_map(function (MethodGenerator $generatedMethod) use($originalClass, $classGenerator) {
         ClassGeneratorUtils::addMethodIfNotFinal($originalClass, $classGenerator, $generatedMethod);
     }, array_merge(array_map(function (ReflectionMethod $method) use($prefixInterceptors, $suffixInterceptors, $valueHolder) {
         return InterceptedMethod::generateMethod(new MethodReflection($method->getDeclaringClass()->getName(), $method->getName()), $valueHolder, $prefixInterceptors, $suffixInterceptors);
     }, ProxiedMethodsFilter::getProxiedMethods($originalClass)), [Constructor::generateMethod($originalClass, $valueHolder), new StaticProxyConstructor($originalClass, $valueHolder, $prefixInterceptors, $suffixInterceptors), new GetWrappedValueHolderValue($valueHolder), new SetMethodPrefixInterceptor($prefixInterceptors), new SetMethodSuffixInterceptor($suffixInterceptors), new MagicGet($originalClass, $valueHolder, $prefixInterceptors, $suffixInterceptors, $publicProperties), new MagicSet($originalClass, $valueHolder, $prefixInterceptors, $suffixInterceptors, $publicProperties), new MagicIsset($originalClass, $valueHolder, $prefixInterceptors, $suffixInterceptors, $publicProperties), new MagicUnset($originalClass, $valueHolder, $prefixInterceptors, $suffixInterceptors, $publicProperties), new MagicClone($originalClass, $valueHolder, $prefixInterceptors, $suffixInterceptors), new MagicSleep($originalClass, $valueHolder), new MagicWakeup($originalClass, $valueHolder)]));
 }