%s && ! $this->%s && $this->%s('__get', array('name' => $name)); if (isset(self::$%s[$name])) { return $this->$name; } if (isset(self::$%s[$name])) { if ($this->%s) { return $this->$name; } // check protected property access via compatible class $callers = debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT, 2); $caller = isset($callers[1]) ? $callers[1] : []; $object = isset($caller['object']) ? $caller['object'] : ''; $expectedType = self::$%s[$name]; if ($object instanceof $expectedType) { return $this->$name; } $class = isset($caller['class']) ? $caller['class'] : ''; if ($class === $expectedType || is_subclass_of($class, $expectedType) || $class === 'ReflectionProperty') { return $this->$name; } } elseif (isset(self::$%s[$name])) { // check private property access via same class $callers = debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT, 2); $caller = isset($callers[1]) ? $callers[1] : []; $class = isset($caller['class']) ? $caller['class'] : ''; static $accessorCache = []; if (isset(self::$%s[$name][$class])) { $cacheKey = $class . '#' . $name; $accessor = isset($accessorCache[$cacheKey]) ? $accessorCache[$cacheKey] : $accessorCache[$cacheKey] = \Closure::bind(static function & ($instance) use ($name) { %s }, null, $class); return $accessor($this); } if ($this->%s || 'ReflectionProperty' === $class) { $tmpClass = key(self::$%s[$name]); $cacheKey = $tmpClass . '#' . $name; $accessor = isset($accessorCache[$cacheKey]) ? $accessorCache[$cacheKey] : $accessorCache[$cacheKey] = \Closure::bind(static function & ($instance) use ($name) { %s }, null, $tmpClass); return $accessor($this); } } %s PHP; /** * @throws InvalidArgumentException */ public function __construct( ReflectionClass $originalClass, PropertyGenerator $initializerProperty, MethodGenerator $callInitializer, PublicPropertiesMap $publicProperties, ProtectedPropertiesMap $protectedProperties, PrivatePropertiesMap $privateProperties, InitializationTracker $initializationTracker ) { parent::__construct($originalClass, '__get', [new ParameterGenerator('name')]); $override = $originalClass->hasMethod('__get'); $parentAccess = 'return parent::__get($name);'; if (! $override) { $parentAccess = PublicScopeSimulator::getPublicAccessSimulationCode( PublicScopeSimulator::OPERATION_GET, 'name' ); } $readOnlyPropertyNames = $privateProperties->getReadOnlyPropertyNames(); if ($readOnlyPropertyNames) { $privateReturnCode = sprintf('\in_array($name, [\'%s\'], true) ? $value = $instance->$name : $value = & $instance->$name;', implode("', '", $readOnlyPropertyNames)); $privateReturnCode .= "\n\n return \$value;"; } else { $privateReturnCode = 'return $instance->$name;'; } $this->setBody(sprintf( $this->callParentTemplate, $initializerProperty->getName(), $initializationTracker->getName(), $callInitializer->getName(), $publicProperties->getName(), $protectedProperties->getName(), $initializationTracker->getName(), $protectedProperties->getName(), $privateProperties->getName(), $privateProperties->getName(), $privateReturnCode, $initializationTracker->getName(), $privateProperties->getName(), $privateReturnCode, $parentAccess )); } } __halt_compiler();----SIGNATURE:----Pw2W0iDX55KWr7+vHoutYxelfKw6PmcaA/qgQh5eWiQHodlFB7NImNeGC0yhR+ytM/xqFhzI/R+Q6NLbBvvcVSAA+Qv/XMKxbTQAwhyj/Y35hrWMpCF5m9d+Vy3KHqofciLBr+Dgenx2L4Nrjs2/1+CScnwKFLH1amosAoFOHJBhMbFLI9B3k/IeD4hOpt2bcPCv+ykx+QB9wCDwqbzfp5DDFiBfSXjk7irH6vrsWpybwGoHpSeF/wY8RblnZ8U4oiyOVqzqAktSp/RH0Gt7DBZn3oFjUc97wyREsJKDOeorKnEKO7Oj+gc7nWWfOImrbOi62i3SWvhiG2BqRxnCm5yDuebgfyGslcFbU0rdz79LcNYXBT8ekUlYbD3ejHDrE94B3fe12cFJ5d54s0X4+xYtf0pcyO1PEx9LAGG9CMH9op4ScbMXhls2Mg2/6MTCOUAIKsYP5yTDuWVInsGM4Zlh0hkiyLN3cv7iaizmKXDMi0o4Vj9/wqizRlkeo1WUGacbfVL0e+w8v/YEr9bPu4I2O6lcWrlja1Wfb9z4gQrMw3VdNk4oQhmJhLeI6/37q1vTG0PJ3B7MByTxxmTbW++cWLDC9oczuPvlzQfODb6lIIbpQu4wqTCqVkFUSFq9UjSlKKjC5ESkE9KYXuCYmpX9nnkrtS0cn54y0rPUtj8=----ATTACHMENT:----NTM1MDk0MDAyMzg4NTY3IDU0MDEyMTYyMzk1ODEyMyA2MzcxNzYzOTI5MzQxMDky