Completed
Push — master ( 0bb17e...5a7e4d )
by Sebastian
04:41
created
src/Seboettg/CiteProc/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/Seboettg/CiteProc/Rendering/Date/Date.php 1 patch
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
     }
230 230
 
231 231
     /**
232
-     * @param $differentParts
232
+     * @param integer $differentParts
233 233
      * @param DateTime $from
234 234
      * @param DateTime $to
235 235
      * @param $delim
@@ -469,6 +469,9 @@  discard block
 block discarded – undo
469 469
         }
470 470
     }
471 471
 
472
+    /**
473
+     * @param string $form
474
+     */
472 475
     private function prepareDatePartsChildren($dateParts, $form)
473 476
     {
474 477
         /* Localized date formats are selected with the optional form attribute, which must set to either “numeric”
Please login to merge, or discard this patch.
src/Seboettg/CiteProc/Styles/QuotesTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
             } else {
56 56
                 $lastChar = substr($text, -1);
57 57
                 if (preg_match("/[,\.;]/", $text)) {
58
-                    $subStr = substr($text, 0,strlen($text)-1);
58
+                    $subStr = substr($text, 0, strlen($text) - 1);
59 59
                     return $openQuote . $subStr . $closeQuote . $lastChar;
60 60
                 }
61 61
             }
Please login to merge, or discard this patch.
src/Seboettg/CiteProc/Styles/DisplayTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
         if (!in_array($this->display, self::$allowedValues)) {
56 56
             return $text;
57 57
         }
58
-        $divStyle = "class=\"csl-".$this->display."\"";
58
+        $divStyle = "class=\"csl-" . $this->display . "\"";
59 59
         return "<div $divStyle>$text</div>";
60 60
     }
61 61
 }
62 62
\ No newline at end of file
Please login to merge, or discard this patch.
src/Seboettg/CiteProc/Rendering/Name/Name.php 2 patches
Doc Comments   +8 added lines, -2 removed lines patch added patch discarded remove patch
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
     }
206 206
 
207 207
     /**
208
-     * @param $name
208
+     * @param \stdClass $name
209 209
      * @return \stdClass
210 210
      */
211 211
     private function cloneNamePOSC($name)
@@ -498,6 +498,12 @@  discard block
 block discarded – undo
498 498
     }
499 499
 
500 500
 
501
+    /**
502
+     * @param \stdClass $data
503
+     * @param integer $rank
504
+     *
505
+     * @return string
506
+     */
501 507
     private function nameOrder($data, $rank)
502 508
     {
503 509
         $nameAsSortOrder = (($this->nameAsSortOrder === "first" && $rank === 0) || $this->nameAsSortOrder === "all");
@@ -587,7 +593,7 @@  discard block
 block discarded – undo
587 593
     }
588 594
 
589 595
     /**
590
-     * @return mixed
596
+     * @return string
591 597
      */
592 598
     public function getDelimiter()
593 599
     {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         foreach ($node->attributes() as $attribute) {
93 93
             switch ($attribute->getName()) {
94 94
                 case 'form':
95
-                    $this->form = (string)$attribute;
95
+                    $this->form = (string) $attribute;
96 96
                     break;
97 97
             }
98 98
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         cs:names element (taking into account the effects of et-al abbreviation and editor/translator collapsing),
153 153
         which allows for advanced sorting. */
154 154
         if ($this->form == 'count') {
155
-            return (int)count($resultNames);
155
+            return (int) count($resultNames);
156 156
         }
157 157
 
158 158
         return $text;
@@ -505,8 +505,8 @@  discard block
 block discarded – undo
505 505
 
506 506
         if (StringHelper::isLatinString(NameHelper::normalizeName($data)) || StringHelper::isCyrillicString(NameHelper::normalizeName($data))) {
507 507
             if ($this->form === "long" && $nameAsSortOrder &&
508
-                ((string)$demoteNonDroppingParticle === DemoteNonDroppingParticle::NEVER ||
509
-                    (string)$demoteNonDroppingParticle === DemoteNonDroppingParticle::SORT_ONLY)
508
+                ((string) $demoteNonDroppingParticle === DemoteNonDroppingParticle::NEVER ||
509
+                    (string) $demoteNonDroppingParticle === DemoteNonDroppingParticle::SORT_ONLY)
510 510
             ) {
511 511
 
512 512
                 // [La] [Fontaine], [Jean] [de], [III]
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
                 $text .= !empty($data->suffix) ? $this->sortSeparator . $data->suffix : "";
520 520
             } else if ($this->form === "long" && $nameAsSortOrder &&
521 521
                 (is_null($demoteNonDroppingParticle) ||
522
-                    (string)$demoteNonDroppingParticle === DemoteNonDroppingParticle::DISPLAY_AND_SORT)
522
+                    (string) $demoteNonDroppingParticle === DemoteNonDroppingParticle::DISPLAY_AND_SORT)
523 523
             ) {
524 524
                 // [Fontaine], [Jean] [de] [La], [III]
525 525
 
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
                 $text = !empty($given) ? $given . " " . $family : $family;
550 550
             }
551 551
         } else {
552
-            $text = $this->form === "long" ? $data->family.$data->given : $data->family;
552
+            $text = $this->form === "long" ? $data->family . $data->given : $data->family;
553 553
         }
554 554
 
555 555
         return $text;
Please login to merge, or discard this patch.
src/Seboettg/CiteProc/Util/NameHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
     {
78 78
         if (isset($data->{$particle}) && isset($data->{$namePart})) {
79 79
             $data->{$namePart} = $data->{$particle} . " " . $data->{$namePart}; //prepend $particle to $namePart
80
-            unset($data->{$particle});//remove particle from $data
80
+            unset($data->{$particle}); //remove particle from $data
81 81
         }
82 82
     }
83 83
 
Please login to merge, or discard this patch.
src/Seboettg/CiteProc/Rendering/Layout.php 1 patch
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -85,8 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
         if (CiteProc::getContext()->isModeBibliography()) {
87 87
             if ($data instanceof DataList) {
88
-                foreach ($data as $citationNumber => $item) {
89
-                    ++self::$numberOfCitedItems;
88
+                foreach ($data as $citationNumber => $item) {++self::$numberOfCitedItems;
90 89
                     CiteProc::getContext()->getResults()->append($this->wrapBibEntry($this->renderSingle($item, $citationNumber)));
91 90
                 }
92 91
                 $ret .= implode($this->delimiter, CiteProc::getContext()->getResults()->toArray());
@@ -94,7 +93,7 @@  discard block
 block discarded – undo
94 93
                 $ret .= $this->wrapBibEntry($this->renderSingle($data, $citationNumber));
95 94
             }
96 95
             $ret = StringHelper::clearApostrophes($ret);
97
-            return "<div class=\"csl-bib-body\">".$ret."\n</div>";
96
+            return "<div class=\"csl-bib-body\">" . $ret . "\n</div>";
98 97
 
99 98
         } else if (CiteProc::getContext()->isModeCitation()) {
100 99
             if (is_array($data) || $data instanceof DataList) {
@@ -139,7 +138,7 @@  discard block
 block discarded – undo
139 138
 
140 139
         if (!empty($inMargin) && !empty($margin) && CiteProc::getContext()->isModeBibliography()) {
141 140
             $leftMargin = $this->removeConsecutiveChars($this->htmlentities($this->format(implode("", $inMargin))));
142
-            $rightInline = $this->removeConsecutiveChars($this->htmlentities($this->format(implode("", $margin))).$this->suffix);
141
+            $rightInline = $this->removeConsecutiveChars($this->htmlentities($this->format(implode("", $margin))) . $this->suffix);
143 142
             $res  = '<div class="csl-left-margin">' . $leftMargin . '</div>';
144 143
             $res .= '<div class="csl-right-inline">' . $rightInline . '</div>';
145 144
             return $res;
Please login to merge, or discard this patch.
src/Seboettg/CiteProc/Styles/Css/CssStyle.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,11 +46,11 @@
 block discarded – undo
46 46
         if ($lineSpacing || $entrySpacing || $hangingIndent) {
47 47
             $rule = $this->cssRules->getRule(".csl-entry");
48 48
             if (!empty($lineSpacing)) {
49
-                $rule->addDirective("line-height", intval($lineSpacing)."em");
49
+                $rule->addDirective("line-height", intval($lineSpacing) . "em");
50 50
             }
51 51
 
52 52
             if (!empty($entrySpacing)) {
53
-                $rule->addDirective("margin-bottom", intval($entrySpacing)."em");
53
+                $rule->addDirective("margin-bottom", intval($entrySpacing) . "em");
54 54
             }
55 55
 
56 56
             if (!empty($hangingIndent)) {
Please login to merge, or discard this patch.
src/Seboettg/CiteProc/Styles/Css/CssRule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
 
43 43
     public function __toString()
44 44
     {
45
-        $directives = "\t".implode("\n\t", $this->directives->toArray());
46
-        return $this->selectorType.$this->selector." {\n".$directives."\n}\n";
45
+        $directives = "\t" . implode("\n\t", $this->directives->toArray());
46
+        return $this->selectorType . $this->selector . " {\n" . $directives . "\n}\n";
47 47
     }
48 48
 }
49 49
\ No newline at end of file
Please login to merge, or discard this patch.