-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathAnnotationClass.php
More file actions
64 lines (55 loc) · 1.34 KB
/
AnnotationClass.php
File metadata and controls
64 lines (55 loc) · 1.34 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
namespace DrupalCodeBuilder\Generator;
/**
* Generator for PHP class files that define a class annotation.
*/
class AnnotationClass extends PHPClassFile {
/**
* {@inheritdoc}
*/
public static function componentDataDefinition() {
return parent::componentDataDefinition() + [
// TODO: this is specific to plugins.
'plugin_relative_namespace' => [
'acquired' => TRUE,
],
];
}
/**
* {@inheritdoc}
*/
protected function getClassDocBlockLines() {
$lines = parent::getClassDocBlockLines();
$lines[] = "";
$lines[] = "@Annotation";
return $lines;
}
/**
* {@inheritdoc}
*/
protected function collectSectionBlocks() {
// Set up properties.
// TODO: these properties are only for plugin annotations, but so far
// nothing else uses this generator.
$this->properties[] = $this->createPropertyBlock(
'id',
'string',
[
'docblock_first_line' => 'The plugin ID.',
'prefixes' => ['public'],
]
);
$this->properties[] = $this->createPropertyBlock(
'label',
'\Drupal\Core\Annotation\Translation',
[
'docblock_first_line' => 'The human-readable name of the plugin.',
'prefixes' => ['public'],
]
/*
// TODO: needs:
'@ingroup plugin_translatable',
*/
);
}
}