File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 14
14
namespace ApiPlatform \Core \Annotation ;
15
15
16
16
use ApiPlatform \Core \Exception \InvalidArgumentException ;
17
- use Doctrine \Common \Annotations \Annotation \Attribute ;
18
17
19
18
/**
20
19
* ApiProperty annotation.
24
23
* @Annotation
25
24
* @Target({"METHOD", "PROPERTY"})
26
25
* @Attributes(
26
+ * @Attribute("deprecationReason", type="string"),
27
27
* @Attribute("fetchable", type="bool"),
28
28
* @Attribute("fetchEager", type="bool"),
29
29
* @Attribute("jsonldContext", type="array"),
@@ -74,6 +74,13 @@ final class ApiProperty
74
74
*/
75
75
public $ identifier ;
76
76
77
+ /**
78
+ * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
79
+ *
80
+ * @var string
81
+ */
82
+ private $ deprecationReason ;
83
+
77
84
/**
78
85
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
79
86
*
Original file line number Diff line number Diff line change 14
14
namespace ApiPlatform \Core \Annotation ;
15
15
16
16
use ApiPlatform \Core \Exception \InvalidArgumentException ;
17
- use Doctrine \Common \Annotations \Annotation \Attribute ;
18
17
19
18
/**
20
19
* ApiResource annotation.
Original file line number Diff line number Diff line change @@ -48,13 +48,15 @@ public function testAssignation()
48
48
public function testConstruct ()
49
49
{
50
50
$ property = new ApiProperty ([
51
+ 'deprecationReason ' => 'this field is deprecated ' ,
51
52
'fetchable ' => true ,
52
53
'fetchEager ' => false ,
53
54
'jsonldContext ' => ['foo ' => 'bar ' ],
54
55
'swaggerContext ' => ['foo ' => 'baz ' ],
55
56
'attributes ' => ['unknown ' => 'unknown ' , 'fetchable ' => false ],
56
57
]);
57
58
$ this ->assertEquals ([
59
+ 'deprecation_reason ' => 'this field is deprecated ' ,
58
60
'fetchable ' => false ,
59
61
'fetch_eager ' => false ,
60
62
'jsonld_context ' => ['foo ' => 'bar ' ],
You can’t perform that action at this time.
0 commit comments