Completed
Push — master ( 1d9aa7...03d576 )
by Henri
10:00
created
controller/WebController.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Copyright (c) 2012-2013 Aalto University and University of Helsinki
4
- * MIT License
5
- * see LICENSE.txt for more information
6
- */
3
+     * Copyright (c) 2012-2013 Aalto University and University of Helsinki
4
+     * MIT License
5
+     * see LICENSE.txt for more information
6
+     */
7 7
 
8 8
 /* Register text: namespace needed for jena-text queries */
9 9
 EasyRdf_Namespace::set('text', 'http://jena.apache.org/text#');
Please login to merge, or discard this patch.
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -573,6 +573,7 @@
 block discarded – undo
573 573
 
574 574
     /**
575 575
      * Invokes a very generic errorpage.
576
+     * @param string $message
576 577
      */
577 578
     public function invokeGenericErrorPage($request, $message = null)
578 579
     {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
         // register a Twig filter for generating URLs for vocabulary resources (concepts and groups)
75 75
         $controller = $this; // for use by anonymous function below
76
-        $urlFilter = new Twig_SimpleFilter('link_url', function ($uri, $vocab, $lang, $type = 'page', $clang = null, $term = null) use ($controller) {
76
+        $urlFilter = new Twig_SimpleFilter('link_url', function($uri, $vocab, $lang, $type = 'page', $clang = null, $term = null) use ($controller) {
77 77
             // $vocab can either be null, a vocabulary id (string) or a Vocabulary object
78 78
             if ($vocab === null) {
79 79
                 // target vocabulary is unknown, best bet is to link to the plain URI
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
         $this->twig->addFilter($urlFilter);
115 115
 
116 116
         // register a Twig filter for generating strings from language codes with CLDR
117
-        $langFilter = new Twig_SimpleFilter('lang_name', function ($langcode, $lang) {
117
+        $langFilter = new Twig_SimpleFilter('lang_name', function($langcode, $lang) {
118 118
             return Language::getName($langcode, $lang);
119 119
         });
120 120
         $this->twig->addFilter($langFilter);
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
         // convert to vocids array to support multi-vocabulary search
358 358
         $vocids = ($vocabs !== null && $vocabs !== '') ? explode(' ', $vocabs) : null;
359 359
         $vocabObjects = array();
360
-        foreach($vocids as $vocid) {
360
+        foreach ($vocids as $vocid) {
361 361
             $vocabObjects[] = $this->model->getVocabulary($vocid);
362 362
         }
363 363
         $parameters->setVocabularies($vocabObjects);
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
                 'search_count' => $counts,
384 384
                 'languages' => $this->languages,
385 385
                 'search_results' => $search_results,
386
-                'rest' => $parameters->getOffset()>0,
386
+                'rest' => $parameters->getOffset() > 0,
387 387
                 'global_search' => true,
388 388
                 'term' => $request->getQueryParam('q'),
389 389
                 'lang_list' => $langList,
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
                 'vocab' => $vocab,
447 447
                 'search_results' => $search_results,
448 448
                 'search_count' => $counts,
449
-                'rest' => $parameters->getOffset()>0,
449
+                'rest' => $parameters->getOffset() > 0,
450 450
                 'limit_parent' => $parameters->getParentLimit(),
451 451
                 'limit_type' => $request->getQueryParam('type'),
452 452
                 'limit_group' => $parameters->getGroupLimit(),
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
      * Loads and renders the view containing a list of recent changes in the vocabulary.
593 593
      * @param Request $request
594 594
      */
595
-    public function invokeChangeList($request, $prop='dc:created')
595
+    public function invokeChangeList($request, $prop = 'dc:created')
596 596
     {
597 597
         // set language parameters for gettext
598 598
         $this->setLanguageProperties($request->getLang());
Please login to merge, or discard this patch.
model/Model.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Copyright (c) 2012 Aalto University and University of Helsinki
4
- * MIT License
5
- * see LICENSE.txt for more information
6
- */
3
+     * Copyright (c) 2012 Aalto University and University of Helsinki
4
+     * MIT License
5
+     * see LICENSE.txt for more information
6
+     */
7 7
 
8 8
 /**
9 9
  * Includes the side wide settings.
Please login to merge, or discard this patch.
model/ConceptSearchParameters.php 2 patches
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -116,11 +116,17 @@  discard block
 block discarded – undo
116 116
         return $this->request->getQueryParam('parent') !== '' ? $this->request->getQueryParam('parent') : null;
117 117
     }
118 118
 
119
+    /**
120
+     * @return integer
121
+     */
119 122
     public function getOffset() 
120 123
     {
121 124
         return ($this->request->getQueryParam('offset') && is_numeric($this->request->getQueryParam('offset')) && $this->request->getQueryParam('offset') >= 0) ? $this->request->getQueryParam('offset') : 0;
122 125
     }
123 126
 
127
+    /**
128
+     * @return integer|null
129
+     */
124 130
     public function getSearchLimit()
125 131
     {
126 132
         return $this->config->getDefaultSearchLimit();
@@ -130,6 +136,9 @@  discard block
 block discarded – undo
130 136
         return $this->unique;
131 137
     }
132 138
 
139
+    /**
140
+     * @param boolean $unique
141
+     */
133 142
     public function setUnique($unique) {
134 143
         $this->unique = $unique;
135 144
     }
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,8 +67,9 @@
 block discarded – undo
67 67
     public function getSearchTerm() 
68 68
     {
69 69
         $term = $this->request->getQueryParam('q') ? $this->request->getQueryParam('q') : $this->request->getQueryParam('query');
70
-        if (!$term && $this->rest)
71
-            $term = $this->request->getQueryParam('label');
70
+        if (!$term && $this->rest) {
71
+                    $term = $this->request->getQueryParam('label');
72
+        }
72 73
         $term = trim($term); // surrounding whitespace is not considered significant
73 74
         return strpos($term, "*") === false ? $term . "*" : $term; // default to prefix search
74 75
     }
Please login to merge, or discard this patch.
model/sparql/GenericSparql.php 1 patch
Doc Comments   +2 added lines, -19 removed lines patch added patch discarded remove patch
@@ -143,6 +143,7 @@  discard block
 block discarded – undo
143 143
     /**
144 144
      * @param array $langs Languages to query for
145 145
      * @param string[] $props property names
146
+     * @return string
146 147
      */
147 148
     private function generateCountLangConceptsQuery($langs, $classes, $props) {
148 149
         $gc = $this->graphClause;
@@ -584,7 +585,7 @@  discard block
 block discarded – undo
584 585
 
585 586
     /**
586 587
      * Generate a VALUES clause for limiting the targeted graphs.
587
-     * @param array $vocabs array of Vocabulary objects to target
588
+     * @param Vocabulary[] $vocabs array of Vocabulary objects to target
588 589
      * @return string VALUES clause, or "" if not necessary to limit
589 590
      */
590 591
     protected function formatValuesGraph($vocabs) {
@@ -789,16 +790,7 @@  discard block
 block discarded – undo
789 790
 
790 791
     /**
791 792
      * Query for concepts using a search term.
792
-     * @param string $term search term
793 793
      * @param array $vocabs array of Vocabulary objects to search; empty for global search
794
-     * @param string $lang language code of the returned labels
795
-     * @param string $search_lang language code used for matching labels (null means any language)
796
-     * @param int $limit maximum number of hits to retrieve; 0 for unlimited
797
-     * @param int $offset offset of results to retrieve; 0 for beginning of list
798
-     * @param string $arrayClass the URI for thesaurus array class, or null if not used
799
-     * @param array $types limit search to concepts of the given type(s)
800
-     * @param string $parent limit search to concepts which have the given concept as parent in the transitive broader hierarchy
801
-     * @param string $group limit search to concepts which are in the given group
802 794
      * @param boolean $hidden include matches on hidden labels (default: true)
803 795
      * @param array $fields extra fields to include in the result (array of strings). (default: null = none)
804 796
      * @param boolean $unique restrict results to unique concepts (default: false)
@@ -942,16 +934,7 @@  discard block
 block discarded – undo
942 934
 
943 935
     /**
944 936
      * Query for concepts using a search term.
945
-     * @param string $term search term
946 937
      * @param array $vocabs array of Vocabulary objects to search; empty for global search
947
-     * @param string $lang language code of the returned labels
948
-     * @param string $search_lang language code used for matching labels (null means any language)
949
-     * @param int $limit maximum number of hits to retrieve; 0 for unlimited
950
-     * @param int $offset offset of results to retrieve; 0 for beginning of list
951
-     * @param string $arrayClass the URI for thesaurus array class, or null if not used
952
-     * @param array $types limit search to concepts of the given type(s)
953
-     * @param string $parent limit search to concepts which have the given concept as parent in the transitive broader hierarchy
954
-     * @param string $group limit search to concepts which are in the given group
955 938
      * @param boolean $hidden include matches on hidden labels (default: true)
956 939
      * @param array $fields extra fields to include in the result (array of strings). (default: null = none)
957 940
      * @param boolean $unique restrict results to unique concepts (default: false)
Please login to merge, or discard this patch.
controller/RestController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -171,7 +171,7 @@
 block discarded – undo
171 171
         // convert to vocids array to support multi-vocabulary search
172 172
         $vocids = ($vocabs !== null && $vocabs !== '') ? explode(' ', $vocabs) : array();
173 173
         $vocabObjects = array();
174
-        foreach($vocids as $vocid) {
174
+        foreach ($vocids as $vocid) {
175 175
             $vocabObjects[] = $this->model->getVocabulary($vocid);
176 176
         }
177 177
         $parameters->setVocabularies($vocabObjects);
Please login to merge, or discard this patch.