Skip to content

Commit

Permalink
Add phpdocs type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
kinow authored and osma committed Jan 8, 2019
1 parent 3e4884c commit 1211ff6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
5 changes: 4 additions & 1 deletion controller/WebController.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,10 @@ public function invokeVocabularies($request)

/**
* Invokes the concept page of a single concept in a specific vocabulary.
*
* @param Request $request
*/
public function invokeVocabularyConcept($request)
public function invokeVocabularyConcept(Request $request)
{
$lang = $request->getLang();
$this->setLanguageProperties($lang);
Expand All @@ -221,6 +223,7 @@ public function invokeVocabularyConcept($request)
$this->invokeGenericErrorPage($request);
return;
}
/** @var \Twig\Template $template */
$template = (in_array('skos:Concept', $results[0]->getType()) || in_array('skos:ConceptScheme', $results[0]->getType())) ? $this->twig->loadTemplate('concept-info.twig') : $this->twig->loadTemplate('group-contents.twig');

$crumbs = $vocab->getBreadCrumbs($request->getContentLang(), $uri);
Expand Down
2 changes: 1 addition & 1 deletion model/ConceptProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function getDescription()

/**
* Returns an array of the property values.
* @return array containing ConceptPropertyValue objects.
* @return ConceptMappingPropertyValue[]
*/
public function getValues()
{
Expand Down
3 changes: 3 additions & 0 deletions model/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ public function setVocab($vocabid)

}

/**
* @return Vocabulary
*/
public function getVocab()
{
return $this->vocab;
Expand Down
4 changes: 2 additions & 2 deletions model/Vocabulary.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function getGraph()
/**
* Get the SPARQL implementation for this vocabulary
*
* @return Sparql SPARQL object
* @return GenericSparql SPARQL object
*/
public function getSparql()
{
Expand Down Expand Up @@ -381,7 +381,7 @@ public function getConceptRelateds($uri, $lang)
/**
* Makes a query into the sparql endpoint for a concept.
* @param string $uri the full URI of the concept
* @return array
* @return Concept[]
*/
public function getConceptInfo($uri, $clang)
{
Expand Down
10 changes: 5 additions & 5 deletions model/sparql/GenericSparql.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected function generateQueryPrefixes($query)
/**
* Execute the SPARQL query using the SPARQL client, logging it as well.
* @param string $query SPARQL query to perform
* @return object query result
* @return Result|\EasyRdf\Graph query result
*/
protected function query($query) {
$queryId = sprintf("%05d", rand(0, 99999));
Expand Down Expand Up @@ -457,7 +457,7 @@ private function generateConceptInfoQuery($uris, $arrayClass, $vocabs) {
* @param array $uris concept URIs
* @param \Vocabulary[] $vocabs array of Vocabulary object
* @param string|null $clang content language
* @return mixed query result graph (EasyRdf\Graph), or array of Concept objects
* @return Concept[] array of Concept objects
*/
private function transformConceptInfoResults($result, $uris, $vocabs, $clang) {
$conceptArray = array();
Expand All @@ -474,7 +474,7 @@ private function transformConceptInfoResults($result, $uris, $vocabs, $clang) {
* @param mixed $uris concept URI (string) or array of URIs
* @param string|null $arrayClass the URI for thesaurus array class, or null if not used
* @param \Vocabulary[]|null $vocabs vocabularies to target
* @return \Concept[]
* @return \EasyRdf\Graph
*/
public function queryConceptInfoGraph($uris, $arrayClass = null, $vocabs = array()) {
// if just a single URI is given, put it in an array regardless
Expand All @@ -493,7 +493,7 @@ public function queryConceptInfoGraph($uris, $arrayClass = null, $vocabs = array
* @param string|null $arrayClass the URI for thesaurus array class, or null if not used
* @param \Vocabulary[] $vocabs vocabularies to target
* @param string|null $clang content language
* @return EasyRdf\Graph
* @return Concept[]
*/
public function queryConceptInfo($uris, $arrayClass = null, $vocabs = array(), $clang = null) {
// if just a single URI is given, put it in an array regardless
Expand All @@ -502,7 +502,7 @@ public function queryConceptInfo($uris, $arrayClass = null, $vocabs = array(), $
}
$result = $this->queryConceptInfoGraph($uris, $arrayClass, $vocabs);
if ($result->isEmpty()) {
return;
return [];
}
return $this->transformConceptInfoResults($result, $uris, $vocabs, $clang);
}
Expand Down

0 comments on commit 1211ff6

Please sign in to comment.