Skip to content

Commit 8f511e3

Browse files
authored
Merge pull request #36 from xp-framework/feature/annotated
Make Type, Member and Parameter classes implement the Annotated interface
2 parents e0d7fb7 + 0e08145 commit 8f511e3

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php namespace lang\reflection;
2+
3+
interface Annotated {
4+
5+
/** @return lang.reflection.Annotations */
6+
public function annotations();
7+
8+
/** @return ?lang.reflection.Annotation */
9+
public function annotation(string $type);
10+
11+
}

src/main/php/lang/reflection/Member.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use lang\{XPClass, Reflection, Value};
44

55
/** Base class for constants, properties and methods */
6-
abstract class Member implements Value {
6+
abstract class Member implements Annotated, Value {
77
protected $reflect, $annotations;
88

99
/**

src/main/php/lang/reflection/Parameter.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* @test lang.reflection.unittest.MethodsTest
99
*/
10-
class Parameter {
10+
class Parameter implements Annotated {
1111
private $reflect, $method;
1212
private $annotations= null;
1313

src/main/php/lang/reflection/Type.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* @test lang.reflection.unittest.TypeTest
1010
*/
11-
class Type implements Value {
11+
class Type implements Annotated, Value {
1212
private $reflect;
1313
private $annotations= null;
1414

0 commit comments

Comments
 (0)