@@ 6-74 (lines=69) @@ | ||
3 | namespace PhpBoot\Annotation; |
|
4 | ||
5 | ||
6 | class AnnotationBlock implements \ArrayAccess |
|
7 | { |
|
8 | /** |
|
9 | * AnnotationBlock constructor. |
|
10 | * @param string $name |
|
11 | * @param string $summary |
|
12 | * @param string $description |
|
13 | * @param AnnotationTag[] $children |
|
14 | * @param AnnotationBlock|null $parent |
|
15 | */ |
|
16 | public function __construct($name='', |
|
17 | $summary='', |
|
18 | $description='', |
|
19 | $children=[], |
|
20 | $parent=null) |
|
21 | { |
|
22 | $this->name = $name; |
|
23 | $this->summary = $summary; |
|
24 | $this->description = $description; |
|
25 | $this->children = $children; |
|
26 | $this->parent = $parent; |
|
27 | } |
|
28 | ||
29 | /** |
|
30 | * @var string |
|
31 | */ |
|
32 | public $name = ''; |
|
33 | /** |
|
34 | * @var string |
|
35 | */ |
|
36 | public $summary = ''; |
|
37 | /** |
|
38 | * @var string |
|
39 | */ |
|
40 | public $description=''; |
|
41 | /** |
|
42 | * @var AnnotationTag[] |
|
43 | */ |
|
44 | public $children=[]; |
|
45 | ||
46 | /** |
|
47 | * @var AnnotationTag|null |
|
48 | */ |
|
49 | public $parent; |
|
50 | ||
51 | ||
52 | public function offsetExists($offset) |
|
53 | { |
|
54 | return isset($this->$offset); |
|
55 | } |
|
56 | ||
57 | ||
58 | public function offsetGet($offset) |
|
59 | { |
|
60 | return $this->$offset; |
|
61 | } |
|
62 | ||
63 | ||
64 | public function offsetSet($offset, $value) |
|
65 | { |
|
66 | $this->$offset = $value; |
|
67 | } |
|
68 | ||
69 | ||
70 | public function offsetUnset($offset) |
|
71 | { |
|
72 | unset($this->$offset); |
|
73 | } |
|
74 | } |
@@ 6-106 (lines=101) @@ | ||
3 | namespace PhpBoot\Annotation; |
|
4 | ||
5 | ||
6 | class AnnotationTag implements \ArrayAccess |
|
7 | { |
|
8 | /** |
|
9 | * AnnotationTag constructor. |
|
10 | * @param string $name |
|
11 | * @param string $summary |
|
12 | * @param string $description |
|
13 | * @param array $children |
|
14 | * @param AnnotationBlock|AnnotationTag|null $parent |
|
15 | */ |
|
16 | public function __construct($name='', |
|
17 | $description='', |
|
18 | $children=[], |
|
19 | $parent=null) |
|
20 | { |
|
21 | $this->name = $name; |
|
22 | $this->description = $description; |
|
23 | $this->children = $children; |
|
24 | $this->parent = $parent; |
|
25 | } |
|
26 | ||
27 | /** |
|
28 | * @var string |
|
29 | */ |
|
30 | public $name = ''; |
|
31 | /** |
|
32 | * @var string |
|
33 | */ |
|
34 | public $description=''; |
|
35 | /** |
|
36 | * @var AnnotationBlock[] |
|
37 | */ |
|
38 | public $children=[]; |
|
39 | ||
40 | /** |
|
41 | * @var AnnotationBlock|null |
|
42 | */ |
|
43 | public $parent; |
|
44 | ||
45 | /** |
|
46 | * Whether a offset exists |
|
47 | * @link http://php.net/manual/en/arrayaccess.offsetexists.php |
|
48 | * @param mixed $offset <p> |
|
49 | * An offset to check for. |
|
50 | * </p> |
|
51 | * @return boolean true on success or false on failure. |
|
52 | * </p> |
|
53 | * <p> |
|
54 | * The return value will be casted to boolean if non-boolean was returned. |
|
55 | * @since 5.0.0 |
|
56 | */ |
|
57 | public function offsetExists($offset) |
|
58 | { |
|
59 | return isset($this->$offset); |
|
60 | } |
|
61 | ||
62 | /** |
|
63 | * Offset to retrieve |
|
64 | * @link http://php.net/manual/en/arrayaccess.offsetget.php |
|
65 | * @param mixed $offset <p> |
|
66 | * The offset to retrieve. |
|
67 | * </p> |
|
68 | * @return mixed Can return all value types. |
|
69 | * @since 5.0.0 |
|
70 | */ |
|
71 | public function offsetGet($offset) |
|
72 | { |
|
73 | return $this->$offset; |
|
74 | } |
|
75 | ||
76 | /** |
|
77 | * Offset to set |
|
78 | * @link http://php.net/manual/en/arrayaccess.offsetset.php |
|
79 | * @param mixed $offset <p> |
|
80 | * The offset to assign the value to. |
|
81 | * </p> |
|
82 | * @param mixed $value <p> |
|
83 | * The value to set. |
|
84 | * </p> |
|
85 | * @return void |
|
86 | * @since 5.0.0 |
|
87 | */ |
|
88 | public function offsetSet($offset, $value) |
|
89 | { |
|
90 | $this->$offset = $value; |
|
91 | } |
|
92 | ||
93 | /** |
|
94 | * Offset to unset |
|
95 | * @link http://php.net/manual/en/arrayaccess.offsetunset.php |
|
96 | * @param mixed $offset <p> |
|
97 | * The offset to unset. |
|
98 | * </p> |
|
99 | * @return void |
|
100 | * @since 5.0.0 |
|
101 | */ |
|
102 | public function offsetUnset($offset) |
|
103 | { |
|
104 | unset($this->$offset); |
|
105 | } |
|
106 | } |