These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace SMW\PropertyAnnotator; |
||
4 | |||
5 | use SMW\DataItemFactory; |
||
6 | use SMW\PropertyAnnotator; |
||
7 | |||
8 | /** |
||
9 | * Decorator that contains the reference to the invoked PropertyAnnotator |
||
10 | * |
||
11 | * @ingroup SMW |
||
12 | * |
||
13 | * @license GNU GPL v2+ |
||
14 | * @since 1.9 |
||
15 | * |
||
16 | * @author mwjames |
||
17 | */ |
||
18 | abstract class PropertyAnnotatorDecorator implements PropertyAnnotator { |
||
19 | |||
20 | /** |
||
21 | * @var PropertyAnnotator |
||
22 | */ |
||
23 | protected $propertyAnnotator; |
||
24 | |||
25 | /** |
||
26 | * @var DataItemFactory |
||
27 | */ |
||
28 | protected $dataItemFactory; |
||
29 | |||
30 | /** |
||
31 | * @since 1.9 |
||
32 | * |
||
33 | * @param PropertyAnnotator $propertyAnnotator |
||
34 | */ |
||
35 | 190 | public function __construct( PropertyAnnotator $propertyAnnotator ) { |
|
36 | 190 | $this->propertyAnnotator = $propertyAnnotator; |
|
37 | 190 | $this->dataItemFactory = new DataItemFactory(); |
|
38 | 190 | } |
|
39 | |||
40 | /** |
||
41 | * @see PropertyAnnotator::getSemanticData |
||
42 | * |
||
43 | * @since 1.9 |
||
44 | * |
||
45 | * @return SemanticData |
||
46 | */ |
||
47 | 189 | public function getSemanticData() { |
|
48 | 189 | return $this->propertyAnnotator->getSemanticData(); |
|
49 | } |
||
50 | |||
51 | /** |
||
52 | * @see PropertyAnnotator::addAnnotation |
||
53 | * |
||
54 | * @since 1.9 |
||
55 | * |
||
56 | * @return PropertyAnnotator |
||
57 | */ |
||
58 | 190 | public function addAnnotation() { |
|
59 | |||
60 | 190 | $this->propertyAnnotator->addAnnotation(); |
|
61 | 190 | $this->addPropertyValues(); |
|
62 | |||
63 | 190 | return $this; |
|
64 | } |
||
65 | |||
66 | /** |
||
67 | * @since 1.9 |
||
68 | */ |
||
69 | protected abstract function addPropertyValues(); |
||
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
70 | |||
71 | } |
||
72 |