* @license MIT */ class PublicPropertiesDefaults extends PropertyGenerator { /** * @var bool[] */ private $publicProperties = array(); /** * @param \ReflectionClass $originalClass */ public function __construct(ReflectionClass $originalClass) { parent::__construct(UniqueIdentifierGenerator::getIdentifier('publicPropertiesDefaults')); $defaults = $originalClass->getDefaultProperties(); foreach ($originalClass->getProperties(ReflectionProperty::IS_PUBLIC) as $publicProperty) { $name = $publicProperty->getName(); $this->publicProperties[$name] = $defaults[$name]; } $this->setDefaultValue($this->publicProperties); $this->setVisibility(self::VISIBILITY_PRIVATE); $this->setStatic(true); $this->setDocblock('@var mixed[] map of default property values of the parent class'); } }