File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
-
3
2
namespace Ubiquity \annotations ;
4
3
5
4
/**
6
5
* Annotation Transformer.
7
6
* usage :
8
7
* - transformer("name"=>"transformerName")
8
+ * - transformer("transformerName")
9
9
*
10
10
* @author jc
11
- * @version 1.0.1
11
+ * @version 1.0.2
12
12
* @usage('property'=>true, 'inherited'=>true)
13
13
* @since Ubiquity 2.1.1
14
14
*/
15
15
class TransformerAnnotation extends BaseAnnotation {
16
+
16
17
public $ name ;
17
18
18
19
/**
19
20
* Initialize the annotation.
20
21
*/
21
22
public function initAnnotation (array $ properties ) {
22
- if (isset ( $ properties [0 ] )) {
23
- $ this ->name = $ properties [0 ];
24
- unset ( $ properties [0 ] );
23
+ if (isset ($ properties [0 ])) {
24
+ $ this ->name = $ properties [0 ];
25
+ unset($ properties [0 ]);
26
+ } else if (isset ($ properties ['name ' ])) {
27
+ $ this ->name = $ properties ['name ' ];
25
28
} else {
26
- throw new \Exception ( 'Transformer annotation must have a name ' );
29
+ throw new \Exception ( 'Transformer annotation must have a name ' );
27
30
}
28
31
}
29
32
}
You can’t perform that action at this time.
0 commit comments