@@ -14,103 +14,103 @@ |
||
| 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 | ]; |
@@ -13,13 +13,13 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | function vendorPath() { |
| 15 | 15 | |
| 16 | - if (file_exists(__DIR__ . '/vendor/')) { |
|
| 17 | - return __DIR__ . '/vendor'; |
|
| 16 | + if (file_exists(__DIR__.'/vendor/')) { |
|
| 17 | + return __DIR__.'/vendor'; |
|
| 18 | 18 | } else { |
| 19 | - if (!file_exists(__DIR__ . '/../../')) { |
|
| 19 | + if (!file_exists(__DIR__.'/../../')) { |
|
| 20 | 20 | return false; |
| 21 | 21 | } else { |
| 22 | - return __DIR__ . '/../..'; |
|
| 22 | + return __DIR__.'/../..'; |
|
| 23 | 23 | } |
| 24 | 24 | } |
| 25 | 25 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -include __DIR__ . "/../vendor/autoload.php"; |
|
| 3 | +include __DIR__."/../vendor/autoload.php"; |
|
| 4 | 4 | use Seboettg\CiteProc\StyleSheet; |
| 5 | 5 | use Seboettg\CiteProc\CiteProc; |
| 6 | 6 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | margin: 0.5em 0; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - <?php echo "\n" . $cssStyles; ?> |
|
| 34 | + <?php echo "\n".$cssStyles; ?> |
|
| 35 | 35 | </style> |
| 36 | 36 | </head> |
| 37 | 37 | <body> |
@@ -87,20 +87,20 @@ discard block |
||
| 87 | 87 | "bibliography" => [ |
| 88 | 88 | "author" => function($authorItem, $renderedText) { |
| 89 | 89 | if (isset($authorItem->id)) { |
| 90 | - return '<a href="https://example.org/author/' . $authorItem->id . '">' . $renderedText . '</a>'; |
|
| 90 | + return '<a href="https://example.org/author/'.$authorItem->id.'">'.$renderedText.'</a>'; |
|
| 91 | 91 | } |
| 92 | 92 | return $renderedText; |
| 93 | 93 | }, |
| 94 | 94 | "title" => function($cslItem, $renderedText) { |
| 95 | - return '<a href="https://example.org/publication/' . $cslItem->id . '">' . $renderedText . '</a>'; |
|
| 95 | + return '<a href="https://example.org/publication/'.$cslItem->id.'">'.$renderedText.'</a>'; |
|
| 96 | 96 | }, |
| 97 | 97 | "csl-entry" => function($cslItem, $renderedText) { |
| 98 | - return '<a id="' . $cslItem->id .'" href="#' . $cslItem->id .'"></a>' . $renderedText; |
|
| 98 | + return '<a id="'.$cslItem->id.'" href="#'.$cslItem->id.'"></a>'.$renderedText; |
|
| 99 | 99 | } |
| 100 | 100 | ], |
| 101 | 101 | "citation" => [ |
| 102 | 102 | "citation-number" => function($cslItem, $renderedText) { |
| 103 | - return '<a href="#' . $cslItem->id .'">'.$renderedText.'</a>'; |
|
| 103 | + return '<a href="#'.$cslItem->id.'">'.$renderedText.'</a>'; |
|
| 104 | 104 | } |
| 105 | 105 | ] |
| 106 | 106 | ]); |
@@ -185,8 +185,8 @@ discard block |
||
| 185 | 185 | // test case group_ShortOutputOnly.json |
| 186 | 186 | $renderedText = ""; |
| 187 | 187 | if (in_array($this->form, ["short", "long"])) { |
| 188 | - $attrWithPrefix = $this->form . ucfirst($this->toRenderTypeValue); |
|
| 189 | - $attrWithSuffix = $this->toRenderTypeValue . "-" . $this->form; |
|
| 188 | + $attrWithPrefix = $this->form.ucfirst($this->toRenderTypeValue); |
|
| 189 | + $attrWithSuffix = $this->toRenderTypeValue."-".$this->form; |
|
| 190 | 190 | if (isset($data->{$attrWithPrefix}) && !empty($data->{$attrWithPrefix})) { |
| 191 | 191 | $renderedText = $this->applyTextCase(StringHelper::clearApostrophes($data->{$attrWithPrefix}), $lang); |
| 192 | 192 | } else { |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | $macro = CiteProc::getContext()->getMacro($this->toRenderTypeValue); |
| 247 | 247 | if (is_null($macro)) { |
| 248 | 248 | try { |
| 249 | - throw new CiteProcException("Macro \"" . $this->toRenderTypeValue . "\" does not exist."); |
|
| 249 | + throw new CiteProcException("Macro \"".$this->toRenderTypeValue."\" does not exist."); |
|
| 250 | 250 | } catch (CiteProcException $e) { |
| 251 | 251 | $renderedText = ""; |
| 252 | 252 | } |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | if (empty($ordinalSuffix)) { |
| 152 | 152 | $ordinalSuffix = CiteProc::getContext()->getLocale()->filter('terms', 'ordinal')->single; |
| 153 | 153 | } |
| 154 | - return $num . $ordinalSuffix; |
|
| 154 | + return $num.$ordinalSuffix; |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | /** |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | */ |
| 161 | 161 | public static function longOrdinal($num) { |
| 162 | 162 | $num = sprintf("%02d", $num); |
| 163 | - $ret = CiteProc::getContext()->getLocale()->filter('terms', 'long-ordinal-' . $num)->single; |
|
| 163 | + $ret = CiteProc::getContext()->getLocale()->filter('terms', 'long-ordinal-'.$num)->single; |
|
| 164 | 164 | if (!$ret) { |
| 165 | 165 | return self::ordinal($num); |
| 166 | 166 | } |
@@ -176,11 +176,11 @@ discard block |
||
| 176 | 176 | public function buildNumberRangeString($num1, $num2, $delim) { |
| 177 | 177 | |
| 178 | 178 | if (self::RANGE_DELIMITER_AMPERSAND === $delim) { |
| 179 | - $numRange = "$num1 " . htmlentities(self::RANGE_DELIMITER_AMPERSAND) . " $num2"; |
|
| 179 | + $numRange = "$num1 ".htmlentities(self::RANGE_DELIMITER_AMPERSAND)." $num2"; |
|
| 180 | 180 | } else if (self::RANGE_DELIMITER_COMMA === $delim) { |
| 181 | - $numRange = $num1 . htmlentities(self::RANGE_DELIMITER_COMMA) . " $num2"; |
|
| 181 | + $numRange = $num1.htmlentities(self::RANGE_DELIMITER_COMMA)." $num2"; |
|
| 182 | 182 | } else { |
| 183 | - $numRange = $num1 . self::RANGE_DELIMITER_HYPHEN . $num2; |
|
| 183 | + $numRange = $num1.self::RANGE_DELIMITER_HYPHEN.$num2; |
|
| 184 | 184 | } |
| 185 | 185 | return $numRange; |
| 186 | 186 | } |
@@ -126,8 +126,8 @@ |
||
| 126 | 126 | public function renderNumeric() |
| 127 | 127 | { |
| 128 | 128 | $ret = $this->year; |
| 129 | - $ret .= $this->month > 0 && $this->month < 13 ? "-" . sprintf("%02s", $this->month) : ""; |
|
| 130 | - $ret .= $this->day > 0 && $this->day < 32 ? "-" . sprintf("%02s", $this->day) : ""; |
|
| 129 | + $ret .= $this->month > 0 && $this->month < 13 ? "-".sprintf("%02s", $this->month) : ""; |
|
| 130 | + $ret .= $this->day > 0 && $this->day < 32 ? "-".sprintf("%02s", $this->day) : ""; |
|
| 131 | 131 | return $ret; |
| 132 | 132 | } |
| 133 | 133 | } |
| 134 | 134 | \ No newline at end of file |
@@ -146,11 +146,11 @@ discard block |
||
| 146 | 146 | { |
| 147 | 147 | $text = $date->getYear(); |
| 148 | 148 | if ($text > 0 && $text < 1000) { |
| 149 | - $text = $text . CiteProc::getContext()->getLocale()->filter("terms", "ad")->single; |
|
| 149 | + $text = $text.CiteProc::getContext()->getLocale()->filter("terms", "ad")->single; |
|
| 150 | 150 | return $text; |
| 151 | 151 | } elseif ($text < 0) { |
| 152 | 152 | $text = $text * -1; |
| 153 | - $text = $text . CiteProc::getContext()->getLocale()->filter("terms", "bc")->single; |
|
| 153 | + $text = $text.CiteProc::getContext()->getLocale()->filter("terms", "bc")->single; |
|
| 154 | 154 | return $text; |
| 155 | 155 | } |
| 156 | 156 | return $text; |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | if (empty($form)) { |
| 224 | 224 | $form = "long"; |
| 225 | 225 | } |
| 226 | - $month = 'month-' . sprintf('%02d', $text); |
|
| 226 | + $month = 'month-'.sprintf('%02d', $text); |
|
| 227 | 227 | $text = CiteProc::getContext()->getLocale()->filter('terms', $month, $form)->single; |
| 228 | 228 | return $text; |
| 229 | 229 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | foreach ($node->attributes() as $attribute) { |
| 99 | 99 | switch ($attribute->getName()) { |
| 100 | 100 | case 'form': |
| 101 | - $this->form = (string)$attribute; |
|
| 101 | + $this->form = (string) $attribute; |
|
| 102 | 102 | break; |
| 103 | 103 | } |
| 104 | 104 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | cs:names element (taking into account the effects of et-al abbreviation and editor/translator collapsing), |
| 161 | 161 | which allows for advanced sorting. */ |
| 162 | 162 | if ($this->form == 'count') { |
| 163 | - return (int)count($resultNames); |
|
| 163 | + return (int) count($resultNames); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | return $text; |
@@ -262,17 +262,17 @@ discard block |
||
| 262 | 262 | |
| 263 | 263 | switch ($this->delimiterPrecedesEtAl) { |
| 264 | 264 | case 'never': |
| 265 | - $text = $text . " " . $this->etAl; |
|
| 265 | + $text = $text." ".$this->etAl; |
|
| 266 | 266 | break; |
| 267 | 267 | case 'always': |
| 268 | - $text = $text . $this->delimiter . $this->etAl; |
|
| 268 | + $text = $text.$this->delimiter.$this->etAl; |
|
| 269 | 269 | break; |
| 270 | 270 | case 'contextual': |
| 271 | 271 | default: |
| 272 | 272 | if (count($resultNames) === 1) { |
| 273 | - $text .= " " . $this->etAl; |
|
| 273 | + $text .= " ".$this->etAl; |
|
| 274 | 274 | } else { |
| 275 | - $text .= $this->delimiter . $this->etAl; |
|
| 275 | + $text .= $this->delimiter.$this->etAl; |
|
| 276 | 276 | } |
| 277 | 277 | } |
| 278 | 278 | } |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | $text = implode(" ", $resultNames); |
| 455 | 455 | } else { // >2 |
| 456 | 456 | $lastName = array_pop($resultNames); |
| 457 | - $text = implode($this->delimiter, $resultNames) . " " . $lastName; |
|
| 457 | + $text = implode($this->delimiter, $resultNames)." ".$lastName; |
|
| 458 | 458 | } |
| 459 | 459 | } |
| 460 | 460 | return $text; |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | { |
| 484 | 484 | $count = count($resultNames); |
| 485 | 485 | if (!empty($this->and) && $count > 1 && empty($this->etAl)) { |
| 486 | - $new = $this->and . ' ' . end($resultNames); // add and-prefix of the last name if "and" is defined |
|
| 486 | + $new = $this->and.' '.end($resultNames); // add and-prefix of the last name if "and" is defined |
|
| 487 | 487 | $resultNames[count($resultNames) - 1] = $new; //set prefixed last name at the last position of $resultNames array |
| 488 | 488 | } |
| 489 | 489 | } |
@@ -528,8 +528,8 @@ discard block |
||
| 528 | 528 | |
| 529 | 529 | if (StringHelper::isLatinString(NameHelper::normalizeName($data)) || StringHelper::isCyrillicString(NameHelper::normalizeName($data))) { |
| 530 | 530 | if ($this->form === "long" && $nameAsSortOrder && |
| 531 | - ((string)$demoteNonDroppingParticle === DemoteNonDroppingParticle::NEVER || |
|
| 532 | - (string)$demoteNonDroppingParticle === DemoteNonDroppingParticle::SORT_ONLY) |
|
| 531 | + ((string) $demoteNonDroppingParticle === DemoteNonDroppingParticle::NEVER || |
|
| 532 | + (string) $demoteNonDroppingParticle === DemoteNonDroppingParticle::SORT_ONLY) |
|
| 533 | 533 | ) { |
| 534 | 534 | |
| 535 | 535 | // [La] [Fontaine], [Jean] [de], [III] |
@@ -538,11 +538,11 @@ discard block |
||
| 538 | 538 | |
| 539 | 539 | list($family, $given) = $this->renderNameParts($data); |
| 540 | 540 | |
| 541 | - $text = $family . (!empty($given) ? $this->sortSeparator . $given : ""); |
|
| 542 | - $text .= !empty($data->suffix) ? $this->sortSeparator . $data->suffix : ""; |
|
| 541 | + $text = $family.(!empty($given) ? $this->sortSeparator.$given : ""); |
|
| 542 | + $text .= !empty($data->suffix) ? $this->sortSeparator.$data->suffix : ""; |
|
| 543 | 543 | } else if ($this->form === "long" && $nameAsSortOrder && |
| 544 | 544 | (is_null($demoteNonDroppingParticle) || |
| 545 | - (string)$demoteNonDroppingParticle === DemoteNonDroppingParticle::DISPLAY_AND_SORT) |
|
| 545 | + (string) $demoteNonDroppingParticle === DemoteNonDroppingParticle::DISPLAY_AND_SORT) |
|
| 546 | 546 | ) { |
| 547 | 547 | // [Fontaine], [Jean] [de] [La], [III] |
| 548 | 548 | |
@@ -550,14 +550,14 @@ discard block |
||
| 550 | 550 | NameHelper::appendParticleTo($data, "given", "non-dropping-particle"); |
| 551 | 551 | list($family, $given) = $this->renderNameParts($data); |
| 552 | 552 | $text = $family; |
| 553 | - $text .= !empty($given) ? $this->sortSeparator . $given : ""; |
|
| 554 | - $text .= !empty($data->suffix) ? $this->sortSeparator . $data->suffix : ""; |
|
| 553 | + $text .= !empty($given) ? $this->sortSeparator.$given : ""; |
|
| 554 | + $text .= !empty($data->suffix) ? $this->sortSeparator.$data->suffix : ""; |
|
| 555 | 555 | |
| 556 | 556 | } else if ($this->form === "long" && $nameAsSortOrder && empty($demoteNonDroppingParticle)) { |
| 557 | 557 | list($family, $given) = $this->renderNameParts($data); |
| 558 | 558 | $text = $family; |
| 559 | - $text .= !empty($given) ? $this->delimiter . $given : ""; |
|
| 560 | - $text .= !empty($data->suffix) ? $this->sortSeparator . $data->suffix : ""; |
|
| 559 | + $text .= !empty($given) ? $this->delimiter.$given : ""; |
|
| 560 | + $text .= !empty($data->suffix) ? $this->sortSeparator.$data->suffix : ""; |
|
| 561 | 561 | } else if ($this->form === "short") { |
| 562 | 562 | // [La] [Fontaine] |
| 563 | 563 | NameHelper::prependParticleTo($data, "family", "non-dropping-particle"); |
@@ -569,7 +569,7 @@ discard block |
||
| 569 | 569 | NameHelper::prependParticleTo($data, "family", "dropping-particle"); |
| 570 | 570 | NameHelper::appendParticleTo($data, "family", "suffix"); |
| 571 | 571 | list($family, $given) = $this->renderNameParts($data); |
| 572 | - $text = !empty($given) ? $given . " " . $family : $family; |
|
| 572 | + $text = !empty($given) ? $given." ".$family : $family; |
|
| 573 | 573 | } |
| 574 | 574 | } else { |
| 575 | 575 | $text = $this->form === "long" ? $data->family.$data->given : $data->family; |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | } else { |
| 174 | 174 | $arr = []; |
| 175 | 175 | foreach ($data->editor as $editor) { |
| 176 | - $edt = $this->format($editor->family . ", " . $editor->given); |
|
| 176 | + $edt = $this->format($editor->family.", ".$editor->given); |
|
| 177 | 177 | $results[] = NameHelper::addExtendedMarkup('editor', $editor, $edt); |
| 178 | 178 | } |
| 179 | 179 | $str .= implode($this->delimiter, $arr); |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | } |
| 209 | 209 | } else { |
| 210 | 210 | foreach ($data->{$var} as $name) { |
| 211 | - $formatted = $this->format($name->given . " " . $name->family); |
|
| 211 | + $formatted = $this->format($name->given." ".$name->family); |
|
| 212 | 212 | $results[] = NameHelper::addExtendedMarkup($var, $name, $formatted); |
| 213 | 213 | } |
| 214 | 214 | } |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | { |
| 238 | 238 | $this->label->setVariable($var); |
| 239 | 239 | if (in_array($this->label->getForm(), ["verb", "verb-short"])) { |
| 240 | - $name = $this->label->render($data) . $name; |
|
| 240 | + $name = $this->label->render($data).$name; |
|
| 241 | 241 | } else { |
| 242 | 242 | $name .= $this->label->render($data); |
| 243 | 243 | } |