-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBaseAnnotation.php
More file actions
50 lines (41 loc) · 1011 Bytes
/
BaseAnnotation.php
File metadata and controls
50 lines (41 loc) · 1011 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* This file is part of Blitz PHP framework.
*
* (c) 2022 Dimitri Sitchet Tomkeu <devcode.dst@gmail.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace BlitzPHP\Annotations;
use mindplay\annotations\Annotation;
use ReflectionClass;
/**
* Classe abstraite servant de base pour les annotations
*/
abstract class BaseAnnotation extends Annotation
{
/**
* @var mixed
*
* La valeur de cette annotation
*/
public $value;
/**
* Recupère la valeur de cette annotation
*
* @return mixed
*/
public function getValue()
{
if (! empty($this->value)) {
return $this->value;
}
$value = [];
$reflection = new ReflectionClass($this);
foreach ($reflection->getProperties() as $property) {
$value[$property->getName()] = $property->getValue();
}
return $value;
}
}