* @license MIT */ class PublicPropertiesMap extends PropertyGenerator { /** * @var bool[] */ private $publicProperties = []; /** * @param Properties $properties * * @throws \Zend\Code\Generator\Exception\InvalidArgumentException */ public function __construct(Properties $properties) { parent::__construct(IdentifierSuffixer::getIdentifier('publicProperties')); foreach ($properties->getPublicProperties() as $publicProperty) { $this->publicProperties[$publicProperty->getName()] = true; } $this->setDefaultValue($this->publicProperties); $this->setVisibility(self::VISIBILITY_PRIVATE); $this->setStatic(true); $this->setDocBlock('@var bool[] map of public properties of the parent class'); } public function isEmpty() : bool { return ! $this->publicProperties; } }