Completed
Push — version1.x ( 6e72a3...d4a6f6 )
by Sebastian
04:16
created
vendorPath.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -29,19 +29,19 @@
 block discarded – undo
29 29
 
30 30
 if (!function_exists('vendorPath')) {
31 31
 
32
-	/**
33
-	 * @return bool|string returns path of composer vendor folder, and false if folder does not exist
34
-	 */
35
-	function vendorPath() {
32
+    /**
33
+     * @return bool|string returns path of composer vendor folder, and false if folder does not exist
34
+     */
35
+    function vendorPath() {
36 36
 
37
-		if (file_exists(__DIR__ . '/vendor/')) {
38
-			return __DIR__ . '/vendor';
39
-		} else {
40
-			if (!file_exists(__DIR__ . '/../../')) {
41
-				return false;
42
-			} else {
43
-				return __DIR__ . '/../..';
44
-			}
45
-		}
46
-	}
37
+        if (file_exists(__DIR__ . '/vendor/')) {
38
+            return __DIR__ . '/vendor';
39
+        } else {
40
+            if (!file_exists(__DIR__ . '/../../')) {
41
+                return false;
42
+            } else {
43
+                return __DIR__ . '/../..';
44
+            }
45
+        }
46
+    }
47 47
 }
48 48
\ No newline at end of file
Please login to merge, or discard this patch.
src/Date.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -94,9 +94,10 @@
 block discarded – undo
94 94
                 }
95 95
                 // now re-order the elements
96 96
                 foreach ($parts as $part) {
97
-                    foreach ($locale_elements as $key => $element)
98
-                        if ($element->name == $part) {
97
+                    foreach ($locale_elements as $key => $element) {
98
+                                            if ($element->name == $part) {
99 99
                             $this->elements[] = $element;
100
+                    }
100 101
                             unset($locale_elements[$key]);
101 102
                         }
102 103
                 }
Please login to merge, or discard this patch.
src/Names.php 1 patch
Braces   +18 added lines, -12 removed lines patch added patch discarded remove patch
@@ -55,8 +55,9 @@  discard block
 block discarded – undo
55 55
         foreach ($domNode->childNodes as $node) {
56 56
             if ($node->nodeType == 1) {
57 57
                 $element = Factory::create($node, $citeProc);
58
-                if (($element instanceof Label))
59
-                    $element->variable = $var;
58
+                if (($element instanceof Label)) {
59
+                                    $element->variable = $var;
60
+                }
60 61
                 if (($element instanceof Name) && $etal) {
61 62
                     $element->etal = $etal;
62 63
                 }
@@ -79,8 +80,9 @@  discard block
 block discarded – undo
79 80
         $variables = explode(' ', $this->variable);
80 81
 
81 82
         foreach ($variables as $var) {
82
-            if (in_array($var, $this->citeProc->quash))
83
-                continue;
83
+            if (in_array($var, $this->citeProc->quash)) {
84
+                            continue;
85
+            }
84 86
             if (isset($data->{$var}) && (!empty($data->{$var}))) {
85 87
                 $matches[] = $var;
86 88
             }
@@ -100,18 +102,21 @@  discard block
 block discarded – undo
100 102
                     } else { // if it's not a "names" element, just render it
101 103
                         $text = $element->render($data, $mode);
102 104
                         $this->citeProc->quash[] = isset($element->variable) ? $element->variable : $element->var;
103
-                        if (!empty($text))
104
-                            $variable_parts[] = $text;
105
+                        if (!empty($text)) {
106
+                                                    $variable_parts[] = $text;
107
+                        }
108
+                    }
109
+                    if (!empty($matches)) {
110
+                                            break;
105 111
                     }
106
-                    if (!empty($matches))
107
-                        break;
108 112
                 }
109 113
             }
110 114
         }
111 115
 
112 116
         foreach ($matches as $var) {
113
-            if (in_array($var, $this->citeProc->quash) && in_array($var, $variables))
114
-                continue;
117
+            if (in_array($var, $this->citeProc->quash) && in_array($var, $variables)) {
118
+                            continue;
119
+            }
115 120
             $text = '';
116 121
             if (!empty($data->{$var})) {
117 122
                 foreach ($this->elements as $element) {
@@ -123,8 +128,9 @@  discard block
 block discarded – undo
123 128
                     }
124 129
                 }
125 130
             }
126
-            if (!empty($text))
127
-                $variable_parts[] = $text;
131
+            if (!empty($text)) {
132
+                            $variable_parts[] = $text;
133
+            }
128 134
         }
129 135
 
130 136
         if (!empty($variable_parts)) {
Please login to merge, or discard this patch.
src/Group.php 1 patch
Braces   +11 added lines, -6 removed lines patch added patch discarded remove patch
@@ -78,12 +78,17 @@
 block discarded – undo
78 78
                 }
79 79
             }
80 80
         }
81
-        if (empty($text_parts))
82
-            return;
83
-        if ($variables && !$have_variables)
84
-            return; // there has to be at least one other none empty value before the term is output
85
-        if (count($text_parts) == $terms)
86
-            return; // there has to be at least one other none empty value before the term is output
81
+        if (empty($text_parts)) {
82
+                    return;
83
+        }
84
+        if ($variables && !$have_variables) {
85
+                    return;
86
+        }
87
+        // there has to be at least one other none empty value before the term is output
88
+        if (count($text_parts) == $terms) {
89
+                    return;
90
+        }
91
+        // there has to be at least one other none empty value before the term is output
87 92
         $delimiter = $this->delimiter;
88 93
         //$text = implode($delimiter, $text_parts); // insert the delimiter if supplied.
89 94
         $text = $this->implodeGroup($delimiter, $text_parts);
Please login to merge, or discard this patch.
src/Locale.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
     public function __construct($lang = 'en') {
114 114
 
115 115
         $this->module_path = dirname(__FILE__);
116
-	    $this->locale = new \SimpleXMLElement(self::getLocalesFileName($lang));
116
+        $this->locale = new \SimpleXMLElement(self::getLocalesFileName($lang));
117 117
 
118 118
         if ($this->locale) {
119 119
             $this->locale->registerXPathNamespace('cs', 'http://purl.org/net/xbiblio/csl');
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -218,8 +218,9 @@
 block discarded – undo
218 218
                     $option = $this->locale->xpath("//cs:style-options[@$arg1]");
219 219
                 }
220 220
                 foreach ($option[0]->attributes() as $name => $value) {
221
-                    if ($name == $arg1)
222
-                        return (string) $value;
221
+                    if ($name == $arg1) {
222
+                                            return (string) $value;
223
+                    }
223 224
                 }
224 225
                 break;
225 226
         }
Please login to merge, or discard this patch.
src/PIf.php 1 patch
Braces   +45 added lines, -30 removed lines patch added patch discarded remove patch
@@ -36,35 +36,45 @@  discard block
 block discarded – undo
36 36
             $matches = 0;
37 37
             foreach ($types as $type) {
38 38
                 if (isset($data->type)) {
39
-                    if ($data->type == $type && $match == 'any')
40
-                        return true;
41
-                    if ($data->type != $type && $match == 'all')
42
-                        return false;
43
-                    if ($data->type == $type)
44
-                        $matches++;
39
+                    if ($data->type == $type && $match == 'any') {
40
+                                            return true;
41
+                    }
42
+                    if ($data->type != $type && $match == 'all') {
43
+                                            return false;
44
+                    }
45
+                    if ($data->type == $type) {
46
+                                            $matches++;
47
+                    }
45 48
                 }
46 49
             }
47
-            if ($match == 'all' && $matches == count($types))
48
-                return true;
49
-            if ($match == 'none' && $matches == 0)
50
-                return true;
50
+            if ($match == 'all' && $matches == count($types)) {
51
+                            return true;
52
+            }
53
+            if ($match == 'none' && $matches == 0) {
54
+                            return true;
55
+            }
51 56
             return false;
52 57
         }
53 58
         if (($variables = $this->variable)) {
54 59
             $variables = explode(' ', $variables);
55 60
             $matches = 0;
56 61
             foreach ($variables as $var) {
57
-                if (isset($data->$var) && !empty($data->$var) && $match == 'any')
58
-                    return true;
59
-                if ((!isset($data->$var) || empty($data->$var)) && $match == 'all')
60
-                    return false;
61
-                if (isset($data->$var) && !empty($data->$var))
62
-                    $matches++;
62
+                if (isset($data->$var) && !empty($data->$var) && $match == 'any') {
63
+                                    return true;
64
+                }
65
+                if ((!isset($data->$var) || empty($data->$var)) && $match == 'all') {
66
+                                    return false;
67
+                }
68
+                if (isset($data->$var) && !empty($data->$var)) {
69
+                                    $matches++;
70
+                }
71
+            }
72
+            if ($match == 'all' && $matches == count($variables)) {
73
+                            return true;
74
+            }
75
+            if ($match == 'none' && $matches == 0) {
76
+                            return true;
63 77
             }
64
-            if ($match == 'all' && $matches == count($variables))
65
-                return true;
66
-            if ($match == 'none' && $matches == 0)
67
-                return true;
68 78
             return false;
69 79
         }
70 80
         if (($is_numeric = $this->{'is-numeric'})) {
@@ -72,8 +82,9 @@  discard block
 block discarded – undo
72 82
             $matches = 0;
73 83
             foreach ($variables as $var) {
74 84
                 if (isset($data->$var)) {
75
-                    if (is_numeric($data->$var) && $match == 'any')
76
-                        return true;
85
+                    if (is_numeric($data->$var) && $match == 'any') {
86
+                                            return true;
87
+                    }
77 88
                     if (!is_numeric($data->$var)) {
78 89
                         if (preg_match('/(?:^\d+|\d+$)/', $data->$var)) {
79 90
                             $matches++;
@@ -81,18 +92,22 @@  discard block
 block discarded – undo
81 92
                             return false;
82 93
                         }
83 94
                     }
84
-                    if (is_numeric($data->$var))
85
-                        $matches++;
95
+                    if (is_numeric($data->$var)) {
96
+                                            $matches++;
97
+                    }
86 98
                 }
87 99
             }
88
-            if ($match == 'all' && $matches == count($variables))
89
-                return true;
90
-            if ($match == 'none' && $matches == 0)
91
-                return true;
100
+            if ($match == 'all' && $matches == count($variables)) {
101
+                            return true;
102
+            }
103
+            if ($match == 'none' && $matches == 0) {
104
+                            return true;
105
+            }
92 106
             return false;
93 107
         }
94
-        if (isset($this->locator))
95
-            $test = explode(' ', $this->type);
108
+        if (isset($this->locator)) {
109
+                    $test = explode(' ', $this->type);
110
+        }
96 111
 
97 112
         return false;
98 113
     }
Please login to merge, or discard this patch.
src/DatePart.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,8 +46,9 @@
 block discarded – undo
46 46
                 break;
47 47
             case 'month':
48 48
                 $text = (isset($date[1])) ? $date[1] : '';
49
-                if (empty($text) || $text < 1 || $text > 12)
50
-                    return;
49
+                if (empty($text) || $text < 1 || $text > 12) {
50
+                                    return;
51
+                }
51 52
                 // $form = $this->form;
52 53
                 switch ($this->form) {
53 54
                     case 'numeric': break;
Please login to merge, or discard this patch.
src/Number.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,8 +30,9 @@
 block discarded – undo
30 30
     public function render($data, $mode = NULL) {
31 31
         $var = $this->variable;
32 32
 
33
-        if (!$var || empty($data->$var))
34
-            return;
33
+        if (!$var || empty($data->$var)) {
34
+                    return;
35
+        }
35 36
 
36 37
         //   $form = $this->form;
37 38
 
Please login to merge, or discard this patch.
src/CiteProc.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
      */
109 109
     function __construct($csl = NULL, $lang = 'en') {
110 110
         if ($csl) {
111
-	        $this->init($csl, $lang);
111
+            $this->init($csl, $lang);
112 112
         }
113 113
     }
114 114
 
Please login to merge, or discard this patch.