Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
ProtectedPropertiesMap.php
01 <?php
02
03 declare(strict_types=1);
04
05 namespace ProxyManager\ProxyGenerator\LazyLoadingGhost\PropertyGenerator;
06
07 use ProxyManager\Generator\Util\IdentifierSuffixer;
08 use ProxyManager\ProxyGenerator\Util\Properties;
09 use Zend\Code\Generator\PropertyGenerator;
10
11 /**
12 * Property that contains the protected instance lazy-loadable properties of an object
13 *
14 * @author Marco Pivetta <ocramius@gmail.com>
15 * @license MIT
16 */
17 class ProtectedPropertiesMap extends PropertyGenerator
18 {
19 const KEY_DEFAULT_VALUE = 'defaultValue';
20
21 /**
22 * Constructor
23 *
24 * @param Properties $properties
25 *
26 * @throws \Zend\Code\Generator\Exception\InvalidArgumentException
27 */
28 public function __construct(Properties $properties)
29 {
30 parent::__construct(
31 IdentifierSuffixer::getIdentifier('protectedProperties')
32 );
33
34 $this->setVisibility(self::VISIBILITY_PRIVATE);
35 $this->setStatic(true);
36 $this->setDocBlock(
37 '@var string[][] declaring class name of defined protected properties, indexed by property name'
38 );
39 $this->setDefaultValue($this->getMap($properties));
40 }
41
42 /**
43 *
44 * @param Properties $properties
45 *
46 * @return int[][]|mixed[][]
47 */
48 private function getMap(Properties $properties) : array
49 {
50 $map = [];
51
52 foreach ($properties->getProtectedProperties() as $property) {
53 $map[$property->getName()] = $property->getDeclaringClass()->getName();
54 }
55
56 return $map;
57 }
58 }
59