| Total Complexity | 10 |
| Total Lines | 63 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class ClassMetadata implements \Serializable |
||
| 14 | { |
||
| 15 | public $name; |
||
| 16 | public $methodMetadata = array(); |
||
| 17 | public $propertyMetadata = array(); |
||
| 18 | public $fileResources = array(); |
||
| 19 | public $createdAt; |
||
| 20 | |||
| 21 | public function __construct(string $name) |
||
| 22 | { |
||
| 23 | $this->name = $name; |
||
| 24 | $this->createdAt = time(); |
||
| 25 | } |
||
| 26 | |||
| 27 | public function addMethodMetadata(MethodMetadata $metadata):void |
||
| 28 | { |
||
| 29 | $this->methodMetadata[$metadata->name] = $metadata; |
||
| 30 | } |
||
| 31 | |||
| 32 | public function addPropertyMetadata(PropertyMetadata $metadata):void |
||
| 33 | { |
||
| 34 | $this->propertyMetadata[$metadata->name] = $metadata; |
||
| 35 | } |
||
| 36 | |||
| 37 | public function isFresh(?int $timestamp = null):bool |
||
| 54 | } |
||
| 55 | |||
| 56 | public function serialize() |
||
| 57 | { |
||
| 58 | return serialize(array( |
||
| 59 | $this->name, |
||
| 60 | $this->methodMetadata, |
||
| 61 | $this->propertyMetadata, |
||
| 62 | $this->fileResources, |
||
| 63 | $this->createdAt, |
||
| 64 | )); |
||
| 65 | } |
||
| 66 | |||
| 67 | public function unserialize($str) |
||
| 76 | } |
||
| 77 | } |
||
| 78 |