Completed
Push — master ( d3db5d...0f1d78 )
by Henri
02:25
created
model/ConceptPropertyValueLiteral.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -10,6 +10,9 @@
 block discarded – undo
10 10
     /** property type */
11 11
     private $type;
12 12
 
13
+    /**
14
+     * @param EasyRdf\Resource $resource
15
+     */
13 16
     public function __construct($model, $vocab, $resource, $literal, $prop)
14 17
     {
15 18
         parent::__construct($model, $vocab, $resource);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
                 return Punic\Calendar::formatDate($val, 'short');
50 50
             } catch (Exception $e) {
51 51
                 trigger_error($e->getMessage(), E_USER_WARNING);
52
-                return (string) $this->literal;
52
+                return (string)$this->literal;
53 53
             }
54 54
         }
55 55
         return $this->literal->getValue();
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         $resources = $graph->resourcesMatching('skosxl:literalForm', $this->literal);
81 81
         foreach ($resources as $xlres) {
82 82
             foreach ($xlres->properties() as $prop) {
83
-                foreach($graph->allLiterals($xlres, $prop) as $val) {
83
+                foreach ($graph->allLiterals($xlres, $prop) as $val) {
84 84
                     if ($prop !== 'rdf:type') {
85 85
                         $ret[$prop] = $val;
86 86
                     }
Please login to merge, or discard this patch.
model/LabelSkosXL.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -3,6 +3,9 @@
 block discarded – undo
3 3
 class LabelSkosXL extends DataObject
4 4
 {
5 5
 
6
+    /**
7
+     * @param Model $model
8
+     */
6 9
     public function __construct($model, $resource)
7 10
     {
8 11
         parent::__construct($model, $resource);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     public function getPrefLabel() {
12 12
         $label;
13 13
         $labels = $this->resource->allResources('skosxl:prefLabel');
14
-        foreach($labels as $labres) {
14
+        foreach ($labels as $labres) {
15 15
             $label = $labres->getLiteral('skosxl:literalForm');
16 16
             if ($label->getLang() == $this->clang) {
17 17
                 return $label;
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     public function getProperties() {
24 24
         $ret = array();
25 25
         $props = $this->resource->properties();
26
-        foreach($props as $prop) {
26
+        foreach ($props as $prop) {
27 27
             if ($prop !== 'skosxl:prefLabel') {
28 28
                 $ret[$prop] = $this->resource->get($prop);
29 29
             }
Please login to merge, or discard this patch.
model/Concept.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -121,9 +121,9 @@  discard block
 block discarded – undo
121 121
 
122 122
         // 3. label in a subtag of the current language
123 123
         // We need to check all the labels in case one of them matches a subtag of the current language
124
-        foreach($this->resource->allLiterals('skos:prefLabel') as $label) {
124
+        foreach ($this->resource->allLiterals('skos:prefLabel') as $label) {
125 125
             // the label lang code is a subtag of the UI lang eg. en-GB - create a new literal with the main language
126
-            if ($label !== null && strpos($label->getLang(), $lang . '-') === 0) {
126
+            if ($label !== null && strpos($label->getLang(), $lang.'-') === 0) {
127 127
                 return EasyRdf\Literal::create($label, $lang);
128 128
             }
129 129
         }
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
         // 4. label in any language, including literal with empty language tag
132 132
         $label = $this->resource->label();
133 133
         if ($label !== null) {
134
-            return $label->getLang() ? $label->getValue() . " (" . $label->getLang() . ")" : $label->getValue();
134
+            return $label->getLang() ? $label->getValue()." (".$label->getLang().")" : $label->getValue();
135 135
         }
136 136
 
137 137
         // empty
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
     public function hasXlLabel($prop = 'prefLabel')
142 142
     {
143
-        if ($this->resource->hasProperty('skosxl:' . $prop)) {
143
+        if ($this->resource->hasProperty('skosxl:'.$prop)) {
144 144
             return true;
145 145
         }
146 146
         return false;
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
     public function getXlLabel()
150 150
     {
151 151
         $labels = $this->resource->allResources('skosxl:prefLabel');
152
-        foreach($labels as $labres) {
152
+        foreach ($labels as $labres) {
153 153
             $label = $labres->getLiteral('skosxl:literalForm');
154 154
             if ($label->getLang() == $this->clang) {
155 155
                 return new LabelSkosXL($this->model, $labres);
@@ -483,14 +483,14 @@  discard block
 block discarded – undo
483 483
 
484 484
             // making a human readable string from the timestamps
485 485
             if ($created != '') {
486
-                $ret = gettext('skosmos:created') . ' ' . (Punic\Calendar::formatDate($created, 'short'));
486
+                $ret = gettext('skosmos:created').' '.(Punic\Calendar::formatDate($created, 'short'));
487 487
             }
488 488
 
489 489
             if ($modified != '') {
490 490
                 if ($created != '') {
491
-                    $ret .= ', ' . gettext('skosmos:modified') . ' ' . (Punic\Calendar::formatDate($modified, 'short'));
491
+                    $ret .= ', '.gettext('skosmos:modified').' '.(Punic\Calendar::formatDate($modified, 'short'));
492 492
                 } else {
493
-                    $ret .= ' ' . ucfirst(gettext('skosmos:modified')) . ' ' . (Punic\Calendar::formatDate($modified, 'short'));
493
+                    $ret .= ' '.ucfirst(gettext('skosmos:modified')).' '.(Punic\Calendar::formatDate($modified, 'short'));
494 494
                 }
495 495
 
496 496
             }
@@ -498,12 +498,12 @@  discard block
 block discarded – undo
498 498
             trigger_error($e->getMessage(), E_USER_WARNING);
499 499
             $ret = '';
500 500
             if ($this->resource->get('dc:modified')) {
501
-                $modified = (string) $this->resource->get('dc:modified');
502
-                $ret = gettext('skosmos:modified') . ' ' . $modified; 
501
+                $modified = (string)$this->resource->get('dc:modified');
502
+                $ret = gettext('skosmos:modified').' '.$modified; 
503 503
             }
504 504
             if ($this->resource->get('dc:created')) {
505
-                $created .= (string) $this->resource->get('dc:created');
506
-                $ret .= ' ' . gettext('skosmos:created') . ' ' . $created; 
505
+                $created .= (string)$this->resource->get('dc:created');
506
+                $ret .= ' '.gettext('skosmos:created').' '.$created; 
507 507
             }
508 508
         }
509 509
         return $ret;
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
         $ret = array();
614 614
         foreach ($labels as $lit) {
615 615
             // filtering away subsets of the current language eg. en vs en-GB
616
-            if ($lit->getLang() != $this->clang && strpos($lit->getLang(), $this->getEnvLang() . '-') !== 0) {
616
+            if ($lit->getLang() != $this->clang && strpos($lit->getLang(), $this->getEnvLang().'-') !== 0) {
617 617
                 $prop = in_array($lit, $prefLabels) ? 'skos:prefLabel' : 'skos:altLabel';
618 618
                 $ret[$this->literalLanguageToString($lit)][] = new ConceptPropertyValueLiteral($this->model, $this->vocab, $this->resource, $lit, $prop);
619 619
             }
Please login to merge, or discard this patch.