Passed
Push — new-api ( 34a0a9...30b18d )
by Sebastian
04:06
created

Plural::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
declare(strict_types=1);
3
/*
4
 * citeproc-php
5
 *
6
 * @link        https://github.com/seboettg/citeproc-php for the source repository
7
 * @copyright   Copyright (c) 2020 Sebastian Böttger.
8
 * @license     https://opensource.org/licenses/MIT
9
 */
10
11
12
namespace Seboettg\CiteProc\Rendering\Label;
13
14
use MyCLabs\Enum\Enum;
15
16
/**
17
 * Defines pluralization of the term, with allowed values:
18
 *
19
 *   - “contextual” - (default), the term plurality matches that of the variable content. Content is considered
20
 *     plural when it contains multiple numbers (e.g. “page 1”, “pages 1-3”, “volume 2”, “volumes 2 & 4”), or, in
21
 *     the case of the “number-of-pages” and “number-of-volumes” variables, when the number is higher than 1
22
 *     (“1 volume” and “3 volumes”).
23
 *   - “always” - always use the plural form, e.g. “pages 1” and “pages 1-3”
24
 *   - “never” - always use the singular form, e.g. “page 1” and “page 1-3”
25
 */
26
class Plural extends Enum
27
{
28
29
    public const CONTEXTUAL = "contextual";
30
31
    public const ALWAYS = "always";
32
33
    public const NEVER = "never";
34
35 4
    public function __construct($value = self::CONTEXTUAL)
0 ignored issues
show
Coding Style introduced by
Incorrect spacing between argument "$value" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$value"; expected 0 but found 1
Loading history...
36
    {
37 4
        parent::__construct($value);
38 4
    }
39
}
40