Passed
Push — issue-71 ( 957702...1ee81d )
by Sebastian
03:42
created
src/Util/Variables.php 1 patch
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -14,103 +14,103 @@
 block discarded – undo
14 14
 {
15 15
 
16 16
     const NAME_VARIABLES = [
17
-        'author',               //author
18
-        'collection-editor',    //editor of the collection holding the item (e.g. the series editor for a book)
19
-        'composer',             //composer (e.g. of a musical score)
20
-        'container-author',     //author of the container holding the item (e.g. the book author for a book chapter)
21
-        'director',             //director (e.g. of a film)
22
-        'editor',               //editor
23
-        'editorial-director',   //managing editor (“Directeur de la Publication” in French)
24
-        'illustrator',          //illustrator (e.g. of a children’s book)
25
-        'interviewer',          //interviewer (e.g. of an interview)
26
-        'original-author',      //
27
-        'recipient',            //recipient (e.g. of a letter)
17
+        'author', //author
18
+        'collection-editor', //editor of the collection holding the item (e.g. the series editor for a book)
19
+        'composer', //composer (e.g. of a musical score)
20
+        'container-author', //author of the container holding the item (e.g. the book author for a book chapter)
21
+        'director', //director (e.g. of a film)
22
+        'editor', //editor
23
+        'editorial-director', //managing editor (“Directeur de la Publication” in French)
24
+        'illustrator', //illustrator (e.g. of a children’s book)
25
+        'interviewer', //interviewer (e.g. of an interview)
26
+        'original-author', //
27
+        'recipient', //recipient (e.g. of a letter)
28 28
         'reviewed-author'       //author of the item reviewed by the current item
29 29
     ];
30 30
 
31 31
     const NUMBER_VARIABLES = [
32
-        'chapter-number',       //chapter number
33
-        'collection-number',    //number identifying the collection holding the item (e.g. the series number for a book)
34
-        'edition',              //(container) edition holding the item (e.g. “3” when citing a chapter in the third
32
+        'chapter-number', //chapter number
33
+        'collection-number', //number identifying the collection holding the item (e.g. the series number for a book)
34
+        'edition', //(container) edition holding the item (e.g. “3” when citing a chapter in the third
35 35
                                 //edition of a book)
36
-        'issue',                //(container) issue holding the item (e.g. “5” when citing a journal article from
36
+        'issue', //(container) issue holding the item (e.g. “5” when citing a journal article from
37 37
                                 //journal volume 2, issue 5)
38
-        'number',               //number identifying the item (e.g. a report number)
39
-        'number-of-pages',      //total number of pages of the cited item
40
-        'number-of-volumes',    //total number of volumes, usable for citing multi-volume books and such
38
+        'number', //number identifying the item (e.g. a report number)
39
+        'number-of-pages', //total number of pages of the cited item
40
+        'number-of-volumes', //total number of volumes, usable for citing multi-volume books and such
41 41
         'volume'                //(container) volume holding the item (e.g. “2” when citing a chapter from book volume 2)
42 42
     ];
43 43
 
44 44
     const DATE_VARIABLES = [
45
-        'accessed',             //date the item has been accessed
45
+        'accessed', //date the item has been accessed
46 46
         'container',
47
-        'event-date',           //date the related event took place
48
-        'issued',               //date the item was issued/published
49
-        'original-date',        //(issue) date of the original version
47
+        'event-date', //date the related event took place
48
+        'issued', //date the item was issued/published
49
+        'original-date', //(issue) date of the original version
50 50
         'submitted'             //date the item (e.g. a manuscript) has been submitted for publication
51 51
     ];
52 52
 
53 53
     const STANDARD_VARIABLE = [
54
-        'abstract',             //abstract of the item (e.g. the abstract of a journal article)
55
-        'annote',               //reader’s notes about the item content
56
-        'archive',              //archive storing the item
57
-        'archive-location',     //storage location within an archive (e.g. a box and folder number)
58
-        'archive-place',        //geographic location of the archive
59
-        'authority',            //issuing or judicial authority (e.g. “USPTO” for a patent, “Fairfax Circuit Court” for
54
+        'abstract', //abstract of the item (e.g. the abstract of a journal article)
55
+        'annote', //reader’s notes about the item content
56
+        'archive', //archive storing the item
57
+        'archive-location', //storage location within an archive (e.g. a box and folder number)
58
+        'archive-place', //geographic location of the archive
59
+        'authority', //issuing or judicial authority (e.g. “USPTO” for a patent, “Fairfax Circuit Court” for
60 60
                                 //a legal case)
61
-        'call-number',          //call number (to locate the item in a library)
62
-        'citation-label',       //label identifying the item in in-text citations of label styles (e.g. “Ferr78”). May
61
+        'call-number', //call number (to locate the item in a library)
62
+        'citation-label', //label identifying the item in in-text citations of label styles (e.g. “Ferr78”). May
63 63
                                 //be assigned by the CSL processor based on item metadata.
64
-        'citation-number',      //index (starting at 1) of the cited reference in the bibliography (generated by the CSL
64
+        'citation-number', //index (starting at 1) of the cited reference in the bibliography (generated by the CSL
65 65
                                 //processor)
66
-        'collection-title',     //title of the collection holding the item (e.g. the series title for a book)
67
-        'container-title',      //title of the container holding the item (e.g. the book title for a book chapter, the
66
+        'collection-title', //title of the collection holding the item (e.g. the series title for a book)
67
+        'container-title', //title of the container holding the item (e.g. the book title for a book chapter, the
68 68
                                 //journal title for a journal article)
69
-        'container-title-short',//short/abbreviated form of “container-title” (also accessible through the “short” form
69
+        'container-title-short', //short/abbreviated form of “container-title” (also accessible through the “short” form
70 70
                                 //of the “container-title” variable)
71
-        'dimensions',           //physical (e.g. size) or temporal (e.g. running time) dimensions of the item
72
-        'DOI',                  //Digital Object Identifier (e.g. “10.1128/AEM.02591-07”)
73
-        'event',                //name of the related event (e.g. the conference name when citing a conference paper)
74
-        'event-place',          //geographic location of the related event (e.g. “Amsterdam, the Netherlands”)
71
+        'dimensions', //physical (e.g. size) or temporal (e.g. running time) dimensions of the item
72
+        'DOI', //Digital Object Identifier (e.g. “10.1128/AEM.02591-07”)
73
+        'event', //name of the related event (e.g. the conference name when citing a conference paper)
74
+        'event-place', //geographic location of the related event (e.g. “Amsterdam, the Netherlands”)
75 75
         'first-reference-note-number', //number of a preceding note containing the first reference to the item. Assigned
76 76
                                 // by the CSL processor. The variable holds no value for non-note-based styles, or when
77 77
                                 // the item hasn’t been cited in any preceding notes.
78
-        'genre',                //class, type or genre of the item (e.g. “adventure” for an adventure movie,
78
+        'genre', //class, type or genre of the item (e.g. “adventure” for an adventure movie,
79 79
                                 //“PhD dissertation” for a PhD thesis),
80
-        'ISBN',                 //International Standard Book Number
81
-        'ISSN',                 //International Standard Serial Number
82
-        'jurisdiction',         //geographic scope of relevance (e.g. “US” for a US patent)
83
-        'keyword',              //keyword(s) or tag(s) attached to the item
84
-        'locator',              //a cite-specific pinpointer within the item (e.g. a page number within a book, or a
80
+        'ISBN', //International Standard Book Number
81
+        'ISSN', //International Standard Serial Number
82
+        'jurisdiction', //geographic scope of relevance (e.g. “US” for a US patent)
83
+        'keyword', //keyword(s) or tag(s) attached to the item
84
+        'locator', //a cite-specific pinpointer within the item (e.g. a page number within a book, or a
85 85
                                 //volume in a multi-volume work). Must be accompanied in the input data by a label
86 86
                                 //indicating the locator type (see the Locators term list), which determines which term
87 87
                                 //is rendered by cs:label when the “locator” variable is selected.
88
-        'medium',               //medium description (e.g. “CD”, “DVD”, etc.)
89
-        'note',                 //(short) inline note giving additional item details (e.g. a concise summary or commentary)
90
-        'original-publisher',   //original publisher, for items that have been republished by a different publisher
88
+        'medium', //medium description (e.g. “CD”, “DVD”, etc.)
89
+        'note', //(short) inline note giving additional item details (e.g. a concise summary or commentary)
90
+        'original-publisher', //original publisher, for items that have been republished by a different publisher
91 91
         'original-publisher-place', //geographic location of the original publisher (e.g. “London, UK”)
92
-        'original-title',       //title of the original version (e.g. “Война и мир”, the untranslated Russian title of
92
+        'original-title', //title of the original version (e.g. “Война и мир”, the untranslated Russian title of
93 93
                                 // “War and Peace”)
94
-        'page',                 //range of pages the item (e.g. a journal article) covers in a container (e.g. a journal
94
+        'page', //range of pages the item (e.g. a journal article) covers in a container (e.g. a journal
95 95
                                 // issue)
96
-        'page-first',           //first page of the range of pages the item (e.g. a journal article) covers in a
96
+        'page-first', //first page of the range of pages the item (e.g. a journal article) covers in a
97 97
                                 //container (e.g. a journal issue)
98
-        'PMCID',                //PubMed Central reference number
99
-        'PMID',                 //PubMed reference number
100
-        'publisher',            //publisher
101
-        'publisher-place',      //geographic location of the publisher
102
-        'references',           //resources related to the procedural history of a legal case
103
-        'reviewed-title',       //title of the item reviewed by the current item
104
-        'scale',                //scale of e.g. a map
105
-        'section',              //container section holding the item (e.g. “politics” for a newspaper article)
106
-        'source',               //from whence the item originates (e.g. a library catalog or database)
107
-        'status',               //(publication) status of the item (e.g. “forthcoming”)
108
-        'title',                //primary title of the item
109
-        'title-short',          //short/abbreviated form of “title” (also accessible through the “short” form of the
98
+        'PMCID', //PubMed Central reference number
99
+        'PMID', //PubMed reference number
100
+        'publisher', //publisher
101
+        'publisher-place', //geographic location of the publisher
102
+        'references', //resources related to the procedural history of a legal case
103
+        'reviewed-title', //title of the item reviewed by the current item
104
+        'scale', //scale of e.g. a map
105
+        'section', //container section holding the item (e.g. “politics” for a newspaper article)
106
+        'source', //from whence the item originates (e.g. a library catalog or database)
107
+        'status', //(publication) status of the item (e.g. “forthcoming”)
108
+        'title', //primary title of the item
109
+        'title-short', //short/abbreviated form of “title” (also accessible through the “short” form of the
110 110
                                 //“title” variable)
111
-        'URL',                  //Uniform Resource Locator (e.g. “http://aem.asm.org/cgi/content/full/74/9/2766”)
112
-        'version',              //version of the item (e.g. “2.0.9” for a software program)
113
-        'year-suffix',          //disambiguating year suffix in author-date styles (e.g. “a” in “Doe, 1999a”)
111
+        'URL', //Uniform Resource Locator (e.g. “http://aem.asm.org/cgi/content/full/74/9/2766”)
112
+        'version', //version of the item (e.g. “2.0.9” for a software program)
113
+        'year-suffix', //disambiguating year suffix in author-date styles (e.g. “a” in “Doe, 1999a”)
114 114
 
115 115
 
116 116
     ];
Please login to merge, or discard this patch.
src/Util/DateHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
             $dateTime = new DateTime($date->{'raw'});
60 60
             $arr = [[$dateTime->format("Y"), $dateTime->format("m"), $dateTime->format("d")]];
61 61
         } catch (Exception $e) {
62
-            throw new CiteProcException("Could not parse date \"" . $date->{'raw'} . "\".", 0, $e);
62
+            throw new CiteProcException("Could not parse date \"".$date->{'raw'}."\".", 0, $e);
63 63
         }
64 64
 
65 65
         return $arr;
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
             } else if ($match === "any" && count($dateParts) === 2) {
113 113
                 return true;
114 114
             } else {
115
-                $ret = ($match === "all") ? $ret & true : $ret | true;
115
+                $ret = ($match === "all") ? $ret&true : $ret|true;
116 116
             }
117 117
         }
118 118
         return boolval($ret);
Please login to merge, or discard this patch.
src/Util/Factory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,9 +54,9 @@
 block discarded – undo
54 54
      */
55 55
     public static function create($node, $param = null)
56 56
     {
57
-        $nodeClass = self::CITE_PROC_NODE_NAMESPACE . self::$nodes[$node->getName()];
57
+        $nodeClass = self::CITE_PROC_NODE_NAMESPACE.self::$nodes[$node->getName()];
58 58
         if (!class_exists($nodeClass)) {
59
-            throw new InvalidStylesheetException("For node {$node->getName()} does not exist any counterpart class \"" . $nodeClass . "\". The given stylesheet seems to be invalid.");
59
+            throw new InvalidStylesheetException("For node {$node->getName()} does not exist any counterpart class \"".$nodeClass."\". The given stylesheet seems to be invalid.");
60 60
         }
61 61
         if ($param != null) {
62 62
             return new $nodeClass($node, $param);
Please login to merge, or discard this patch.
src/Util/PageHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
                 $digitFrom = $from{$i};
66 66
                 if ($digitTo !== $digitFrom) {
67
-                    $resTo = $digitTo . $resTo;
67
+                    $resTo = $digitTo.$resTo;
68 68
                 }
69 69
             }
70 70
             return $resTo;
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
     {
78 78
 
79 79
         if ($from > 100 && ($from % 100 > 0) && intval(($from / 100), 10) === intval(($to / 100), 10)) {
80
-            return "" . ($to % 100);
80
+            return "".($to % 100);
81 81
         } else if ($from >= 10000) {
82
-            return "" . ($to % 1000);
82
+            return "".($to % 1000);
83 83
         }
84 84
         return $to;
85 85
     }
Please login to merge, or discard this patch.
src/Util/StringHelper.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     public static function capitalizeForTitle($titleString)
94 94
     {
95 95
         if (preg_match('/(.+[^\<\>][\.:\/;\?\!]\s?)([a-z])(.+)/', $titleString, $match)) {
96
-            $titleString = $match[1] . StringHelper::mb_ucfirst($match[2]) . $match[3];
96
+            $titleString = $match[1].StringHelper::mb_ucfirst($match[2]).$match[3];
97 97
         }
98 98
 
99 99
         $wordArray = explode(" ", $titleString);
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 
142 142
         /** @noinspection PhpInternalEntityUsedInspection */
143 143
         $encoding = Mbstring::mb_detect_encoding($firstChar, self::ISO_ENCODINGS, true);
144
-        return in_array($encoding, self::ISO_ENCODINGS) ? Mbstring::mb_strtoupper($firstChar, $encoding) . $then : $firstChar . $then;
144
+        return in_array($encoding, self::ISO_ENCODINGS) ? Mbstring::mb_strtoupper($firstChar, $encoding).$then : $firstChar.$then;
145 145
     }
146 146
 
147 147
     /**
@@ -160,13 +160,13 @@  discard block
 block discarded – undo
160 160
             foreach ($spaceExploded as $givenPart) {
161 161
                 $firstLetter = mb_substr($givenPart, 0, 1, "UTF-8");
162 162
                 if (StringHelper::isLatinString($firstLetter)) {
163
-                    $res .= ctype_upper($firstLetter) ? $firstLetter . $initializeSign : " " . $givenPart . " ";
163
+                    $res .= ctype_upper($firstLetter) ? $firstLetter.$initializeSign : " ".$givenPart." ";
164 164
                 } else {
165
-                    $res .= $firstLetter . $initializeSign;
165
+                    $res .= $firstLetter.$initializeSign;
166 166
                 }
167 167
             }
168 168
             if ($i < count($exploded) - 1 && $initializeWithHyphen) {
169
-                $res = rtrim($res) . "-";
169
+                $res = rtrim($res)."-";
170 170
             }
171 171
             ++$i;
172 172
         }
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
     public static function replaceOuterQuotes($text, $outerOpenQuote, $outerCloseQuote, $innerOpenQuote, $innerCloseQuote)
225 225
     {
226 226
         if (preg_match("/(.*)$outerOpenQuote(.+)$outerCloseQuote(.*)/u", $text, $match)) {
227
-            return $match[1] . $innerOpenQuote . $match[2] . $innerCloseQuote . $match[3];
227
+            return $match[1].$innerOpenQuote.$match[2].$innerCloseQuote.$match[3];
228 228
         }
229 229
         return $text;
230 230
     }
@@ -254,6 +254,6 @@  discard block
 block discarded – undo
254 254
      * @return mixed
255 255
      */
256 256
     public static function removeBrackets($datePart) {
257
-        return str_replace(["[","]", "(", ")", "{", "}"], "", $datePart);
257
+        return str_replace(["[", "]", "(", ")", "{", "}"], "", $datePart);
258 258
     }
259 259
 }
260 260
\ No newline at end of file
Please login to merge, or discard this patch.
src/Constraint/AbstractConstraint.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         foreach ($this->conditionVariables as $variable) {
72 72
             $conditionMatched |= $this->matchForVariable($variable, $value);
73 73
         }
74
-        return (bool)$conditionMatched;
74
+        return (bool) $conditionMatched;
75 75
     }
76 76
 
77 77
     private function matchAll($value)
@@ -80,6 +80,6 @@  discard block
 block discarded – undo
80 80
         foreach ($this->conditionVariables as $variable) {
81 81
             $conditionMatched &= $this->matchForVariable($variable, $value);
82 82
         }
83
-        return (bool)$conditionMatched;
83
+        return (bool) $conditionMatched;
84 84
     }
85 85
 }
Please login to merge, or discard this patch.
src/Util/NumberHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      */
51 51
     public static function getCompareNumber()
52 52
     {
53
-        return function ($numA, $numB, $order) {
53
+        return function($numA, $numB, $order) {
54 54
             if (is_numeric($numA) && is_numeric($numB)) {
55 55
                 $ret = $numA - $numB;
56 56
             } else {
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
             $len = strlen($numStr);
77 77
             for ($pos = 0; $pos < $len; $pos++) {
78 78
                 $n = $numStr[$pos];
79
-                $ret = self::ROMAN_NUMERALS[$pos][$n] . $ret;
79
+                $ret = self::ROMAN_NUMERALS[$pos][$n].$ret;
80 80
             }
81 81
         }
82 82
         return $ret;
Please login to merge, or discard this patch.
src/Rendering/Number.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -60,10 +60,10 @@  discard block
 block discarded – undo
60 60
         foreach ($node->attributes() as $attribute) {
61 61
             switch ($attribute->getName()) {
62 62
                 case 'variable':
63
-                    $this->variable = (string)$attribute;
63
+                    $this->variable = (string) $attribute;
64 64
                     break;
65 65
                 case 'form':
66
-                    $this->form = (string)$attribute;
66
+                    $this->form = (string) $attribute;
67 67
             }
68 68
         }
69 69
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
         if (empty($ordinalSuffix)) {
159 159
             $ordinalSuffix = CiteProc::getContext()->getLocale()->filter('terms', 'ordinal')->single;
160 160
         }
161
-        return $num . $ordinalSuffix;
161
+        return $num.$ordinalSuffix;
162 162
     }
163 163
 
164 164
     /**
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
     public static function longOrdinal($num)
169 169
     {
170 170
         $num = sprintf("%02d", $num);
171
-        $ret = CiteProc::getContext()->getLocale()->filter('terms', 'long-ordinal-' . $num)->single;
171
+        $ret = CiteProc::getContext()->getLocale()->filter('terms', 'long-ordinal-'.$num)->single;
172 172
         if (!$ret) {
173 173
             return self::ordinal($num);
174 174
         }
@@ -185,12 +185,12 @@  discard block
 block discarded – undo
185 185
     {
186 186
 
187 187
         if (self::RANGE_DELIMITER_AMPERSAND === $delim) {
188
-            $numRange = "$num1 " . htmlentities(self::RANGE_DELIMITER_AMPERSAND) . " $num2";
188
+            $numRange = "$num1 ".htmlentities(self::RANGE_DELIMITER_AMPERSAND)." $num2";
189 189
         } else {
190 190
             if (self::RANGE_DELIMITER_COMMA === $delim) {
191
-                $numRange = $num1 . htmlentities(self::RANGE_DELIMITER_COMMA) . " $num2";
191
+                $numRange = $num1.htmlentities(self::RANGE_DELIMITER_COMMA)." $num2";
192 192
             } else {
193
-                $numRange = $num1 . self::RANGE_DELIMITER_HYPHEN . $num2;
193
+                $numRange = $num1.self::RANGE_DELIMITER_HYPHEN.$num2;
194 194
             }
195 195
         }
196 196
         return $numRange;
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
             if (preg_match("/\s*([^\-\-&,]+)\s*([\-\-&,])\s*([^\-\-&,]+)\s*/", $number, $matches)) {
208 208
                 $num1 = Util\NumberHelper::roman2Dec($matches[1]);
209 209
                 $num2 = Util\NumberHelper::roman2Dec($matches[3]);
210
-                $decimalNumber = $num1 . $matches[2] . $num2;
210
+                $decimalNumber = $num1.$matches[2].$num2;
211 211
             } else {
212 212
                 $decimalNumber = Util\NumberHelper::roman2Dec($number);
213 213
             }
Please login to merge, or discard this patch.