@@ -205,6 +205,9 @@ |
||
205 | 205 | ); |
206 | 206 | } |
207 | 207 | |
208 | + /** |
|
209 | + * @return \Ask\Language\Description\Description |
|
210 | + */ |
|
208 | 211 | private function buildValueDescriptionsForObjects(ResourceListNode $objectList) { |
209 | 212 | $valueDescriptions = array(); |
210 | 213 |
@@ -129,6 +129,10 @@ |
||
129 | 129 | $resource->image->name = $image->getTitle(); |
130 | 130 | } |
131 | 131 | |
132 | + /** |
|
133 | + * @param string $image |
|
134 | + * @param string $target |
|
135 | + */ |
|
132 | 136 | private function newViewAction(array $nameTerms, $image, $target) { |
133 | 137 | $actionResource = new stdClass(); |
134 | 138 | $actionResource->{'@type'} = 'ViewAction'; |
@@ -58,6 +58,9 @@ |
||
58 | 58 | return $this->entityIdsToEntityIdValues($this->getEntityIdsForValue($value)); |
59 | 59 | } |
60 | 60 | |
61 | + /** |
|
62 | + * @param string $value |
|
63 | + */ |
|
61 | 64 | private function getEntityIdsForValue($value) { |
62 | 65 | $languageCode = $this->getOption(ValueParser::OPT_LANG); |
63 | 66 | $term = new Term($languageCode, $value); |
@@ -38,10 +38,10 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public $cache; |
40 | 40 | |
41 | - /** |
|
42 | - * @var int |
|
43 | - */ |
|
44 | - private $requestStartTime; |
|
41 | + /** |
|
42 | + * @var int |
|
43 | + */ |
|
44 | + private $requestStartTime; |
|
45 | 45 | |
46 | 46 | /** |
47 | 47 | * @param $configFileName |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $configurationBuilder = new EntityStoreFromConfigurationBuilder(); |
52 | 52 | $this->entityStore = $configurationBuilder->buildEntityStore($configFileName); |
53 | 53 | $this->cache = $configurationBuilder->buildCache($configFileName); |
54 | - $this->requestStartTime = time(); |
|
54 | + $this->requestStartTime = time(); |
|
55 | 55 | |
56 | 56 | $this->sitesApi = array(); |
57 | 57 | foreach($sitesUrls as $siteId => $url) { |
@@ -69,26 +69,26 @@ discard block |
||
69 | 69 | |
70 | 70 | if($formattedTree->equals(new ResourceListNode())) { |
71 | 71 | return array(); |
72 | - } |
|
73 | - |
|
74 | - $measures = $this->buildMeasures($formattedTree, $request->getMeasures()); |
|
72 | + } |
|
75 | 73 | |
76 | - $trace = $request->getTrace(); |
|
77 | - array_unshift($trace, array( |
|
78 | - "module" => "Wikidata", |
|
79 | - "tree" => $formattedTree, |
|
80 | - "measures" => $measures, |
|
81 | - "times" => array( |
|
82 | - "start" => $this->requestStartTime, |
|
83 | - "end" => time() |
|
84 | - ) |
|
85 | - )); |
|
74 | + $measures = $this->buildMeasures($formattedTree, $request->getMeasures()); |
|
75 | + |
|
76 | + $trace = $request->getTrace(); |
|
77 | + array_unshift($trace, array( |
|
78 | + "module" => "Wikidata", |
|
79 | + "tree" => $formattedTree, |
|
80 | + "measures" => $measures, |
|
81 | + "times" => array( |
|
82 | + "start" => $this->requestStartTime, |
|
83 | + "end" => time() |
|
84 | + ) |
|
85 | + )); |
|
86 | 86 | |
87 | 87 | return array(new ModuleResponse( |
88 | 88 | $request->getLanguageCode(), |
89 | 89 | $formattedTree, |
90 | - $measures, |
|
91 | - $trace |
|
90 | + $measures, |
|
91 | + $trace |
|
92 | 92 | )); |
93 | 93 | } |
94 | 94 |