Passed
Push — new-api ( 4bfe18...7ec1cc )
by Sebastian
05:06
created

InheritableNameAttributesTrait::setEtAlMin()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
/*
3
 * citeproc-php
4
 *
5
 * @link        http://github.com/seboettg/citeproc-php for the source repository
6
 * @copyright   Copyright (c) 2017 Sebastian Böttger.
7
 * @license     https://opensource.org/licenses/MIT
8
 */
9
10
namespace Seboettg\CiteProc\Style;
11
12
use Seboettg\CiteProc\CiteProc;
13
use Seboettg\CiteProc\Config\RenderingMode;
14
use Seboettg\CiteProc\Rendering\HasParent;
15
use Seboettg\CiteProc\Rendering\Name\Name;
16
use Seboettg\CiteProc\Rendering\Name\Names;
17
use Seboettg\CiteProc\Root\Root;
18
use Seboettg\CiteProc\StyleSheet;
19
use SimpleXMLElement;
20
21
/**
22
 * Class InheritableNameAttributesTrait
23
 *
24
 * Attributes for the cs:names and cs:name elements may also be set on cs:style, cs:citation and cs:bibliography. This
25
 * eliminates the need to repeat the same attributes and attribute values for every occurrence of the cs:names and
26
 * cs:name elements.
27
 *
28
 * The available inheritable attributes for cs:name are and, delimiter-precedes-et-al, delimiter-precedes-last,
29
 * et-al-min, et-al-use-first, et-al-use-last, et-al-subsequent-min, et-al-subsequent-use-first, initialize,
30
 * initialize-with, name-as-sort-order and sort-separator. The attributes name-form and name-delimiter correspond to the
31
 * form and delimiter attributes on cs:name. Similarly, names-delimiter corresponds to the delimiter attribute on
32
 * cs:names.
33
 *
34
 *
35
 * @package Seboettg\CiteProc\Style
36
 * @author Sebastian Böttger <[email protected]>
37
 */
38
trait InheritableNameAttributesTrait
39
{
40
    public static $attributes = [
41
        'and',
42
        'delimiter-precedes-et-al',
43
        'delimiter-precedes-last',
44
        'et-al-min',
45
        'et-al-use-first',
46
        'et-al-use-last',
47
        'et-al-subsequent-min',
48
        'et-al-subsequent-use-first',
49
        'initialize',
50
        'initialize-with',
51
        'name-as-sort-order',
52
        'sort-separator',
53
        'name-form',
54
        'form',
55
        'name-delimiter',
56
        'delimiter'
57
    ];
58
59
    /**
60
     * @var bool
61
     */
62
    protected $attributesInitialized = false;
63
64
    /**
65
     * Specifies the delimiter between the second to last and last name of the names in a name variable. Allowed values
66
     * are “text” (selects the “and” term, e.g. “Doe, Johnson and Smith”) and “symbol” (selects the ampersand,
67
     * e.g. “Doe, Johnson & Smith”).
68
     *
69
     * @var string
70
     */
71
    private $and;
72
73
    /**
74
     * Determines when the name delimiter or a space is used between a truncated name list and the “et-al”
75
     * (or “and others”) term in case of et-al abbreviation. Allowed values:
76
     * - “contextual” - (default), name delimiter is only used for name lists truncated to two or more names
77
     *   - 1 name: “J. Doe et al.”
78
     *   - 2 names: “J. Doe, S. Smith, et al.”
79
     * - “after-inverted-name” - name delimiter is only used if the preceding name is inverted as a result of the
80
     *   - name-as-sort-order attribute. E.g. with name-as-sort-order set to “first”:
81
     *   - “Doe, J., et al.”
82
     *   - “Doe, J., S. Smith et al.”
83
     * - “always” - name delimiter is always used
84
     *   - 1 name: “J. Doe, et al.”
85
     *   - 2 names: “J. Doe, S. Smith, et al.”
86
     * - “never” - name delimiter is never used
87
     *   - 1 name: “J. Doe et al.”
88
     *   - 2 names: “J. Doe, S. Smith et al.”
89
     *
90
     * @var string
91
     */
92
    private $delimiterPrecedesEtAl;
93
94
    /**
95
     * Determines when the name delimiter is used to separate the second to last and the last name in name lists (if
96
     * and is not set, the name delimiter is always used, regardless of the value of delimiter-precedes-last). Allowed
97
     * values:
98
     *
99
     * - “contextual” - (default), name delimiter is only used for name lists with three or more names
100
     *   - 2 names: “J. Doe and T. Williams”
101
     *   - 3 names: “J. Doe, S. Smith, and T. Williams”
102
     * - “after-inverted-name” - name delimiter is only used if the preceding name is inverted as a result of the
103
     *   name-as-sort-order attribute. E.g. with name-as-sort-order set to “first”:
104
     *   - “Doe, J., and T. Williams”
105
     *   - “Doe, J., S. Smith and T. Williams”
106
     * - “always” - name delimiter is always used
107
     *   - 2 names: “J. Doe, and T. Williams”
108
     *   - 3 names: “J. Doe, S. Smith, and T. Williams”
109
     * - “never” - name delimiter is never used
110
     *   - 2 names: “J. Doe and T. Williams”
111
     *   - 3 names: “J. Doe, S. Smith and T. Williams”
112
     *
113
     * @var string
114
     */
115
    private $delimiterPrecedesLast;
116
117
    /**
118
     * Use of etAlMin (et-al-min attribute) and etAlUseFirst (et-al-use-first attribute) enables et-al abbreviation. If
119
     * the number of names in a name variable matches or exceeds the number set on etAlMin, the rendered name list is
120
     * truncated after reaching the number of names set on etAlUseFirst.
121
     *
122
     * @var int
123
     */
124
    private $etAlMin;
125
126
    /**
127
     * Use of etAlMin (et-al-min attribute) and etAlUseFirst (et-al-use-first attribute) enables et-al abbreviation. If
128
     * the number of names in a name variable matches or exceeds the number set on etAlMin, the rendered name list is
129
     * truncated after reaching the number of names set on etAlUseFirst.
130
     *
131
     * @var int
132
     */
133
    private $etAlUseFirst;
134
135
    /**
136
     * When set to “true” (the default is “false”), name lists truncated by et-al abbreviation are followed by the name
137
     * delimiter, the ellipsis character, and the last name of the original name list. This is only possible when the
138
     * original name list has at least two more names than the truncated name list (for this the value of
139
     * et-al-use-first/et-al-subsequent-min must be at least 2 less than the value of
140
     * et-al-min/et-al-subsequent-use-first).
141
     *
142
     * @var bool
143
     */
144
    private $etAlUseLast = false;
145
146
    /**
147
     * If used, the values of these attributes (et-al-subsequent-min and et-al-subsequent-use-first) replace those of
148
     * respectively et-al-min and et-al-use-first for subsequent cites (cites referencing earlier cited items).
149
     *
150
     * @var int
151
     */
152
    private $etAlSubsequentMin;
153
154
    /**
155
     * If used, the values of these attributes (et-al-subsequent-min and et-al-subsequent-use-first) replace those of
156
     * respectively et-al-min and et-al-use-first for subsequent cites (cites referencing earlier cited items).
157
     *
158
     * @var int
159
     */
160
    private $etAlSubsequentUseFirst;
161
162
    /**
163
     * When set to “false” (the default is “true”), given names are no longer initialized when “initialize-with” is set.
164
     * However, the value of “initialize-with” is still added after initials present in the full name (e.g. with
165
     * initialize set to “false”, and initialize-with set to ”.”, “James T Kirk” becomes “James T. Kirk”).
166
     *
167
     * @var bool
168
     */
169
    private $initialize = true;
170
171
    /**
172
     * When set, given names are converted to initials. The attribute value is added after each initial (”.” results
173
     * in “J.J. Doe”). For compound given names (e.g. “Jean-Luc”), hyphenation of the initials can be controlled with
174
     * the global initialize-with-hyphen option
175
     *
176
     * @var string
177
     */
178
    private $initializeWith = false;
179
180
    /**
181
     * Specifies that names should be displayed with the given name following the family name (e.g. “John Doe” becomes
182
     * “Doe, John”). The attribute has two possible values:
183
     *   - “first” - attribute only has an effect on the first name of each name variable
184
     *   - “all” - attribute has an effect on all names
185
     * Note that even when name-as-sort-order changes the name-part order, the display order is not necessarily the same
186
     * as the sorting order for names containing particles and suffixes (see Name-part order). Also, name-as-sort-order
187
     * only affects names written in the latin or Cyrillic alphabets. Names written in other alphabets (e.g. Asian
188
     * scripts) are always displayed with the family name preceding the given name.
189
     *
190
     * @var string
191
     */
192
    private $nameAsSortOrder = "";
193
194
    /**
195
     * Sets the delimiter for name-parts that have switched positions as a result of name-as-sort-order. The default
196
     * value is ”, ” (“Doe, John”). As is the case for name-as-sort-order, this attribute only affects names written in
197
     * the latin or Cyrillic alphabets.
198
     *
199
     * @var string
200
     */
201
    private $sortSeparator = ", ";
202
203
    /**
204
     * Specifies whether all the name-parts of personal names should be displayed (value “long”, the default), or only
205
     * the family name and the non-dropping-particle (value “short”). A third value, “count”, returns the total number
206
     * of names that would otherwise be rendered by the use of the cs:names element (taking into account the effects of
207
     * et-al abbreviation and editor/translator collapsing), which allows for advanced sorting.
208
     *
209
     * @var string
210
     */
211
    private $form;
212
213
    private $nameForm = "long";
214
215
    private $nameDelimiter = ", ";
216
217
    public function isDescendantOfMacro()
218
    {
219
        $parent = $this->parent;
220
221
        while ($parent != null && $parent instanceof HasParent) {
222
            if ($parent instanceof Macro) {
223
                return true;
224
            }
225
            $parent = $parent->getParent();
226
        }
227
        return false;
228
    }
229
230
    /**
231
     * @param SimpleXMLElement $node
232
     */
233
    public function initInheritableNameAttributes(SimpleXMLElement $node)
234
    {
235
        $context = CiteProc::getContext();
236
        $parentStyleElement = null;
237
        if ($this instanceof  Name || $this instanceof Names && !empty($context->getMode())) {
238
            if ($context->getMode()->equals(RenderingMode::BIBLIOGRAPHY())) {
239
                if ($this->isDescendantOfMacro()) {
240
                    $parentStyleElement = $context->getRoot();
241
                } else {
242
                    $parentStyleElement = $context->getBibliography();
243
                }
244
            } else {
245
                $parentStyleElement = $context->getCitation();
246
            }
247
        } elseif ($this instanceof StyleElement) {
248
            $parentStyleElement = $context->getRoot();
249
        }
250
251
        foreach (self::$attributes as $nameAttribute) {
252
            $attribute = $node[$nameAttribute];
253
            switch ($nameAttribute) {
254
                case 'and':
255
                    if (!empty($attribute)) {
256
                        $this->and = (string) $attribute;
0 ignored issues
show
Bug introduced by
The property and is declared private in Seboettg\CiteProc\Rendering\Name\Name and cannot be accessed from this context.
Loading history...
257
                    } elseif (!empty($parentStyleElement)) { //inherit from parent style
258
                        $this->and = $parentStyleElement->getAnd();
0 ignored issues
show
Bug introduced by
The method getAnd() does not exist on Seboettg\CiteProc\Style\Bibliography. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

258
                        /** @scrutinizer ignore-call */ 
259
                        $this->and = $parentStyleElement->getAnd();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getAnd() does not exist on Seboettg\CiteProc\Style\Citation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

258
                        /** @scrutinizer ignore-call */ 
259
                        $this->and = $parentStyleElement->getAnd();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getAnd() does not exist on Seboettg\CiteProc\Root\Root. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

258
                        /** @scrutinizer ignore-call */ 
259
                        $this->and = $parentStyleElement->getAnd();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
259
                    }
260
                    break;
261
                case 'delimiter-precedes-et-al':
262
                    if (!empty($attribute)) {
263
                        $this->delimiterPrecedesEtAl = (string) $attribute;
264
                    } elseif (!empty($parentStyleElement)) { //inherit from parent style
265
                        $this->delimiterPrecedesEtAl = $parentStyleElement->getDelimiterPrecedesEtAl();
0 ignored issues
show
Bug introduced by
The method getDelimiterPrecedesEtAl() does not exist on Seboettg\CiteProc\Style\Bibliography. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

265
                        /** @scrutinizer ignore-call */ 
266
                        $this->delimiterPrecedesEtAl = $parentStyleElement->getDelimiterPrecedesEtAl();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getDelimiterPrecedesEtAl() does not exist on Seboettg\CiteProc\Root\Root. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

265
                        /** @scrutinizer ignore-call */ 
266
                        $this->delimiterPrecedesEtAl = $parentStyleElement->getDelimiterPrecedesEtAl();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getDelimiterPrecedesEtAl() does not exist on Seboettg\CiteProc\Style\Citation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

265
                        /** @scrutinizer ignore-call */ 
266
                        $this->delimiterPrecedesEtAl = $parentStyleElement->getDelimiterPrecedesEtAl();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
266
                    }
267
                    break;
268
                case 'delimiter-precedes-last':
269
                    if (!empty($attribute)) {
270
                        $this->delimiterPrecedesLast = (string) $attribute;
271
                    } elseif (!empty($parentStyleElement)) { //inherit from parent style
272
                        $this->delimiterPrecedesLast = $parentStyleElement->getDelimiterPrecedesLast();
0 ignored issues
show
Bug introduced by
The method getDelimiterPrecedesLast() does not exist on Seboettg\CiteProc\Root\Root. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

272
                        /** @scrutinizer ignore-call */ 
273
                        $this->delimiterPrecedesLast = $parentStyleElement->getDelimiterPrecedesLast();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getDelimiterPrecedesLast() does not exist on Seboettg\CiteProc\Style\Bibliography. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

272
                        /** @scrutinizer ignore-call */ 
273
                        $this->delimiterPrecedesLast = $parentStyleElement->getDelimiterPrecedesLast();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getDelimiterPrecedesLast() does not exist on Seboettg\CiteProc\Style\Citation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

272
                        /** @scrutinizer ignore-call */ 
273
                        $this->delimiterPrecedesLast = $parentStyleElement->getDelimiterPrecedesLast();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
273
                    }
274
                    break;
275
                case 'et-al-min':
276
                    if (!empty($attribute)) {
277
                        $this->etAlMin = intval((string) $attribute);
278
                    } elseif (!empty($parentStyleElement)) {
279
                        $this->etAlMin = $parentStyleElement->getEtAlMin();
0 ignored issues
show
Bug introduced by
The method getEtAlMin() does not exist on Seboettg\CiteProc\Style\Bibliography. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

279
                        /** @scrutinizer ignore-call */ 
280
                        $this->etAlMin = $parentStyleElement->getEtAlMin();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getEtAlMin() does not exist on Seboettg\CiteProc\Style\Citation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

279
                        /** @scrutinizer ignore-call */ 
280
                        $this->etAlMin = $parentStyleElement->getEtAlMin();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getEtAlMin() does not exist on Seboettg\CiteProc\Root\Root. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

279
                        /** @scrutinizer ignore-call */ 
280
                        $this->etAlMin = $parentStyleElement->getEtAlMin();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
280
                    }
281
                    break;
282
                case 'et-al-use-first':
283
                    if (!empty($attribute)) {
284
                        $this->etAlUseFirst = intval((string) $attribute);
285
                    } elseif (!empty($parentStyleElement)) {
286
                        $this->etAlUseFirst = $parentStyleElement->getEtAlUseFirst();
0 ignored issues
show
Bug introduced by
The method getEtAlUseFirst() does not exist on Seboettg\CiteProc\Root\Root. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

286
                        /** @scrutinizer ignore-call */ 
287
                        $this->etAlUseFirst = $parentStyleElement->getEtAlUseFirst();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getEtAlUseFirst() does not exist on Seboettg\CiteProc\Style\Citation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

286
                        /** @scrutinizer ignore-call */ 
287
                        $this->etAlUseFirst = $parentStyleElement->getEtAlUseFirst();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getEtAlUseFirst() does not exist on Seboettg\CiteProc\Style\Bibliography. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

286
                        /** @scrutinizer ignore-call */ 
287
                        $this->etAlUseFirst = $parentStyleElement->getEtAlUseFirst();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
287
                    }
288
                    break;
289
                case 'et-al-subsequent-min':
290
                    if (!empty($attribute)) {
291
                        $this->etAlSubsequentMin = intval((string) $attribute);
292
                    } elseif (!empty($parentStyleElement)) {
293
                        $this->etAlSubsequentMin = $parentStyleElement->getEtAlSubsequentMin();
0 ignored issues
show
Bug introduced by
The method getEtAlSubsequentMin() does not exist on Seboettg\CiteProc\Style\Bibliography. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

293
                        /** @scrutinizer ignore-call */ 
294
                        $this->etAlSubsequentMin = $parentStyleElement->getEtAlSubsequentMin();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getEtAlSubsequentMin() does not exist on Seboettg\CiteProc\Style\Citation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

293
                        /** @scrutinizer ignore-call */ 
294
                        $this->etAlSubsequentMin = $parentStyleElement->getEtAlSubsequentMin();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getEtAlSubsequentMin() does not exist on Seboettg\CiteProc\Root\Root. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

293
                        /** @scrutinizer ignore-call */ 
294
                        $this->etAlSubsequentMin = $parentStyleElement->getEtAlSubsequentMin();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
294
                    }
295
                    break;
296
                case 'et-al-subsequent-use-first':
297
                    if (!empty($attribute)) {
298
                        $this->etAlSubsequentUseFirst = intval((string) $attribute);
299
                    } elseif (!empty($parentStyleElement)) {
300
                        $this->etAlSubsequentUseFirst = $parentStyleElement->getEtAlSubsequentUseFirst();
0 ignored issues
show
Bug introduced by
The method getEtAlSubsequentUseFirst() does not exist on Seboettg\CiteProc\Style\Bibliography. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

300
                        /** @scrutinizer ignore-call */ 
301
                        $this->etAlSubsequentUseFirst = $parentStyleElement->getEtAlSubsequentUseFirst();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getEtAlSubsequentUseFirst() does not exist on Seboettg\CiteProc\Root\Root. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

300
                        /** @scrutinizer ignore-call */ 
301
                        $this->etAlSubsequentUseFirst = $parentStyleElement->getEtAlSubsequentUseFirst();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getEtAlSubsequentUseFirst() does not exist on Seboettg\CiteProc\Style\Citation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

300
                        /** @scrutinizer ignore-call */ 
301
                        $this->etAlSubsequentUseFirst = $parentStyleElement->getEtAlSubsequentUseFirst();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
301
                    }
302
                    break;
303
                case 'et-al-use-last':
304
                    if (!empty($attribute)) {
305
                        $this->etAlUseLast = boolval((string) $attribute);
306
                    } elseif (!empty($parentStyleElement)) {
307
                        $this->etAlUseLast = $parentStyleElement->getEtAlUseLast();
0 ignored issues
show
Bug introduced by
The method getEtAlUseLast() does not exist on Seboettg\CiteProc\Style\Bibliography. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

307
                        /** @scrutinizer ignore-call */ 
308
                        $this->etAlUseLast = $parentStyleElement->getEtAlUseLast();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getEtAlUseLast() does not exist on Seboettg\CiteProc\Root\Root. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

307
                        /** @scrutinizer ignore-call */ 
308
                        $this->etAlUseLast = $parentStyleElement->getEtAlUseLast();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getEtAlUseLast() does not exist on Seboettg\CiteProc\Style\Citation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

307
                        /** @scrutinizer ignore-call */ 
308
                        $this->etAlUseLast = $parentStyleElement->getEtAlUseLast();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
308
                    }
309
                    break;
310
                case 'initialize':
311
                    if (!empty($attribute)) {
312
                        $this->initialize = boolval((string) $attribute);
313
                    } elseif (!empty($parentStyleElement)) {
314
                        $this->initialize = $parentStyleElement->getInitialize();
0 ignored issues
show
Bug introduced by
The method getInitialize() does not exist on Seboettg\CiteProc\Style\Bibliography. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

314
                        /** @scrutinizer ignore-call */ 
315
                        $this->initialize = $parentStyleElement->getInitialize();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getInitialize() does not exist on Seboettg\CiteProc\Root\Root. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

314
                        /** @scrutinizer ignore-call */ 
315
                        $this->initialize = $parentStyleElement->getInitialize();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getInitialize() does not exist on Seboettg\CiteProc\Style\Citation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

314
                        /** @scrutinizer ignore-call */ 
315
                        $this->initialize = $parentStyleElement->getInitialize();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
315
                    }
316
                    break;
317
                case 'initialize-with':
318
                    if (!empty($attribute)) {
319
                        $this->initializeWith = (string) $attribute;
320
                    } elseif (!empty($parentStyleElement)) {
321
                        $this->initializeWith = $parentStyleElement->getInitializeWith();
0 ignored issues
show
Bug introduced by
The method getInitializeWith() does not exist on Seboettg\CiteProc\Root\Root. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

321
                        /** @scrutinizer ignore-call */ 
322
                        $this->initializeWith = $parentStyleElement->getInitializeWith();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getInitializeWith() does not exist on Seboettg\CiteProc\Style\Citation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

321
                        /** @scrutinizer ignore-call */ 
322
                        $this->initializeWith = $parentStyleElement->getInitializeWith();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getInitializeWith() does not exist on Seboettg\CiteProc\Style\Bibliography. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

321
                        /** @scrutinizer ignore-call */ 
322
                        $this->initializeWith = $parentStyleElement->getInitializeWith();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
322
                    }
323
                    break;
324
                case 'name-as-sort-order':
325
                    if (!empty($attribute)) {
326
                        $this->nameAsSortOrder = (string) $attribute;
327
                    } elseif (!empty($parentStyleElement)) {
328
                        $this->nameAsSortOrder = $parentStyleElement->getNameAsSortOrder();
0 ignored issues
show
Bug introduced by
The method getNameAsSortOrder() does not exist on Seboettg\CiteProc\Style\Citation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

328
                        /** @scrutinizer ignore-call */ 
329
                        $this->nameAsSortOrder = $parentStyleElement->getNameAsSortOrder();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getNameAsSortOrder() does not exist on Seboettg\CiteProc\Root\Root. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

328
                        /** @scrutinizer ignore-call */ 
329
                        $this->nameAsSortOrder = $parentStyleElement->getNameAsSortOrder();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getNameAsSortOrder() does not exist on Seboettg\CiteProc\Style\Bibliography. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

328
                        /** @scrutinizer ignore-call */ 
329
                        $this->nameAsSortOrder = $parentStyleElement->getNameAsSortOrder();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
329
                    }
330
                    break;
331
                case 'sort-separator':
332
                    if (!empty($attribute)) {
333
                        $this->sortSeparator = (string) $attribute;
334
                    } elseif (!empty($parentStyleElement)) {
335
                        $this->sortSeparator = $parentStyleElement->getSortSeparator();
0 ignored issues
show
Bug introduced by
The method getSortSeparator() does not exist on Seboettg\CiteProc\Root\Root. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

335
                        /** @scrutinizer ignore-call */ 
336
                        $this->sortSeparator = $parentStyleElement->getSortSeparator();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getSortSeparator() does not exist on Seboettg\CiteProc\Style\Citation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

335
                        /** @scrutinizer ignore-call */ 
336
                        $this->sortSeparator = $parentStyleElement->getSortSeparator();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getSortSeparator() does not exist on Seboettg\CiteProc\Style\Bibliography. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

335
                        /** @scrutinizer ignore-call */ 
336
                        $this->sortSeparator = $parentStyleElement->getSortSeparator();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
336
                    }
337
                    break;
338
                case 'name-form':
339
                    if ($this instanceof Root || $this instanceof StyleElement) {
340
                        if (!empty($attribute)) {
341
                            $this->setNameForm((string) $attribute);
342
                        } elseif (!empty($parentStyleElement)) {
343
                            $this->setNameForm($parentStyleElement->getNameForm());
0 ignored issues
show
Bug introduced by
The method getNameForm() does not exist on Seboettg\CiteProc\Root\Root. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

343
                            $this->setNameForm($parentStyleElement->/** @scrutinizer ignore-call */ getNameForm());

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getNameForm() does not exist on Seboettg\CiteProc\Style\Citation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

343
                            $this->setNameForm($parentStyleElement->/** @scrutinizer ignore-call */ getNameForm());

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getNameForm() does not exist on Seboettg\CiteProc\Style\Bibliography. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

343
                            $this->setNameForm($parentStyleElement->/** @scrutinizer ignore-call */ getNameForm());

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
344
                        }
345
                    }
346
                    break;
347
                case 'form':
348
                    if ($this instanceof Name) {
349
                        if (!empty($attribute)) {
350
                            $this->setForm((string) $attribute);
351
                        } elseif (!empty($parentStyleElement)) {
352
                            $this->setForm($parentStyleElement->getNameForm());
353
                        }
354
                    }
355
                    break;
356
                case 'name-delimiter':
357
                    if ($this instanceof Root || $this instanceof StyleElement) {
358
                        if (!empty($attribute)) {
359
                            $this->setNameDelimiter((string) $attribute);
360
                        } elseif (!empty($parentStyleElement)) {
361
                            $this->setNameDelimiter($parentStyleElement->getNameDelimiter());
0 ignored issues
show
Bug introduced by
The method getNameDelimiter() does not exist on Seboettg\CiteProc\Style\Bibliography. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

361
                            $this->setNameDelimiter($parentStyleElement->/** @scrutinizer ignore-call */ getNameDelimiter());

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getNameDelimiter() does not exist on Seboettg\CiteProc\Style\Citation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

361
                            $this->setNameDelimiter($parentStyleElement->/** @scrutinizer ignore-call */ getNameDelimiter());

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method getNameDelimiter() does not exist on Seboettg\CiteProc\Root\Root. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

361
                            $this->setNameDelimiter($parentStyleElement->/** @scrutinizer ignore-call */ getNameDelimiter());

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
362
                        }
363
                    } else {
364
                        /* The attributes name-form and name-delimiter correspond to the form and delimiter attributes
365
                           on cs:name. Similarly, names-delimiter corresponds to the delimiter attribute on cs:names. */
366
                        if (!empty($attribute)) {
367
                            $this->nameDelimiter = $this->delimiter = (string) $attribute;
0 ignored issues
show
Bug Best Practice introduced by
The property delimiter does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
Bug introduced by
The property delimiter is declared private in Seboettg\CiteProc\Rendering\Name\Names and cannot be accessed from this context.
Loading history...
Bug introduced by
The property delimiter is declared private in Seboettg\CiteProc\Rendering\Name\Name and cannot be accessed from this context.
Loading history...
368
                        } elseif (!empty($parentStyleElement)) {
369
                            $this->nameDelimiter = $this->delimiter = $parentStyleElement->getNameDelimiter();
370
                        }
371
                    }
372
                    break;
373
                case 'delimiter':
374
                    if ($this instanceof Name) {
375
                        if (!empty($attribute)) {
376
                            $this->setDelimiter((string) $attribute);
377
                        } elseif (!empty($parentStyleElement)) {
378
                            $this->setDelimiter($parentStyleElement->getNameDelimiter());
379
                        }
380
                    }
381
            }
382
        }
383
        $this->attributesInitialized = true;
384
    }
385
386
    /**
387
     * @return string
388
     */
389
    public function getAnd()
390
    {
391
        return $this->and;
392
    }
393
394
    /**
395
     * @param string $and
396
     */
397
    public function setAnd($and)
398
    {
399
        $this->and = $and;
400
    }
401
402
    /**
403
     * @return string
404
     */
405
    public function getDelimiterPrecedesEtAl()
406
    {
407
        return $this->delimiterPrecedesEtAl;
408
    }
409
410
    /**
411
     * @param string $delimiterPrecedesEtAl
412
     */
413
    public function setDelimiterPrecedesEtAl($delimiterPrecedesEtAl)
414
    {
415
        $this->delimiterPrecedesEtAl = $delimiterPrecedesEtAl;
416
    }
417
418
    /**
419
     * @return string
420
     */
421
    public function getDelimiterPrecedesLast()
422
    {
423
        return $this->delimiterPrecedesLast;
424
    }
425
426
    /**
427
     * @param string $delimiterPrecedesLast
428
     */
429
    public function setDelimiterPrecedesLast($delimiterPrecedesLast)
430
    {
431
        $this->delimiterPrecedesLast = $delimiterPrecedesLast;
432
    }
433
434
    /**
435
     * @return int
436
     */
437
    public function getEtAlMin()
438
    {
439
        return $this->etAlMin;
440
    }
441
442
    /**
443
     * @param int $etAlMin
444
     */
445
    public function setEtAlMin($etAlMin)
446
    {
447
        $this->etAlMin = $etAlMin;
448
    }
449
450
    /**
451
     * @return int
452
     */
453
    public function getEtAlUseFirst()
454
    {
455
        return $this->etAlUseFirst;
456
    }
457
458
    /**
459
     * @param int $etAlUseFirst
460
     */
461
    public function setEtAlUseFirst($etAlUseFirst)
462
    {
463
        $this->etAlUseFirst = $etAlUseFirst;
464
    }
465
466
    /**
467
     * @return bool
468
     */
469
    public function getEtAlUseLast()
470
    {
471
        return $this->etAlUseLast;
472
    }
473
474
    /**
475
     * @param bool $etAlUseLast
476
     */
477
    public function setEtAlUseLast($etAlUseLast)
478
    {
479
        $this->etAlUseLast = $etAlUseLast;
480
    }
481
482
    /**
483
     * @return int
484
     */
485
    public function getEtAlSubsequentMin()
486
    {
487
        return $this->etAlSubsequentMin;
488
    }
489
490
    /**
491
     * @param int $etAlSubsequentMin
492
     */
493
    public function setEtAlSubsequentMin($etAlSubsequentMin)
494
    {
495
        $this->etAlSubsequentMin = $etAlSubsequentMin;
496
    }
497
498
    /**
499
     * @return int
500
     */
501
    public function getEtAlSubsequentUseFirst()
502
    {
503
        return $this->etAlSubsequentUseFirst;
504
    }
505
506
    /**
507
     * @param int $etAlSubsequentUseFirst
508
     */
509
    public function setEtAlSubsequentUseFirst($etAlSubsequentUseFirst)
510
    {
511
        $this->etAlSubsequentUseFirst = $etAlSubsequentUseFirst;
512
    }
513
514
    /**
515
     * @return bool
516
     */
517
    public function getInitialize()
518
    {
519
        return $this->initialize;
520
    }
521
522
    /**
523
     * @param bool $initialize
524
     */
525
    public function setInitialize($initialize)
526
    {
527
        $this->initialize = $initialize;
528
    }
529
530
    /**
531
     * @return string
532
     */
533
    public function getInitializeWith()
534
    {
535
        return $this->initializeWith;
536
    }
537
538
    /**
539
     * @param string $initializeWith
540
     */
541
    public function setInitializeWith($initializeWith)
542
    {
543
        $this->initializeWith = $initializeWith;
544
    }
545
546
    /**
547
     * @return string
548
     */
549
    public function getNameAsSortOrder()
550
    {
551
        return $this->nameAsSortOrder;
552
    }
553
554
    /**
555
     * @param string $nameAsSortOrder
556
     */
557
    public function setNameAsSortOrder($nameAsSortOrder)
558
    {
559
        $this->nameAsSortOrder = $nameAsSortOrder;
560
    }
561
562
    /**
563
     * @return string
564
     */
565
    public function getSortSeparator()
566
    {
567
        return $this->sortSeparator;
568
    }
569
570
    /**
571
     * @param string $sortSeparator
572
     */
573
    public function setSortSeparator($sortSeparator)
574
    {
575
        $this->sortSeparator = $sortSeparator;
576
    }
577
578
    /**
579
     * @return mixed
580
     */
581
    public function getForm()
582
    {
583
        return $this->form;
584
    }
585
586
    /**
587
     * @param mixed $form
588
     */
589
    public function setForm($form)
590
    {
591
        $this->form = $form;
592
    }
593
594
    /**
595
     * @return string
596
     */
597
    public function getNameForm()
598
    {
599
        return $this->nameForm;
600
    }
601
602
    /**
603
     * @param string $nameForm
604
     */
605
    public function setNameForm($nameForm)
606
    {
607
        $this->nameForm = $nameForm;
608
    }
609
610
    /**
611
     * @return string
612
     */
613
    public function getNameDelimiter()
614
    {
615
        return $this->nameDelimiter;
616
    }
617
618
    /**
619
     * @param string $nameDelimiter
620
     */
621
    public function setNameDelimiter($nameDelimiter)
622
    {
623
        $this->nameDelimiter = $nameDelimiter;
624
    }
625
}
626