| Total Complexity | 9 |
| Total Lines | 68 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | class GlobalOptions |
||
| 21 | { |
||
| 22 | |||
| 23 | /** |
||
|
1 ignored issue
–
show
|
|||
| 24 | * @var bool |
||
| 25 | */ |
||
| 26 | private $initializeWithHyphen = true; |
||
| 27 | |||
| 28 | /** |
||
|
1 ignored issue
–
show
|
|||
| 29 | * @var PageRangeFormats |
||
| 30 | */ |
||
| 31 | private $pageRangeFormat; |
||
| 32 | |||
| 33 | /** |
||
|
1 ignored issue
–
show
|
|||
| 34 | * @var DemoteNonDroppingParticle |
||
| 35 | */ |
||
| 36 | private $demoteNonDroppingParticles; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * GlobalOptions constructor. |
||
| 40 | * @param SimpleXMLElement $node |
||
|
2 ignored issues
–
show
|
|||
| 41 | */ |
||
| 42 | public function __construct(SimpleXMLElement $node) |
||
| 43 | { |
||
| 44 | /** @var SimpleXMLElement $attribute */ |
||
|
3 ignored issues
–
show
|
|||
| 45 | foreach ($node->attributes() as $attribute) { |
||
| 46 | switch ($attribute->getName()) { |
||
| 47 | case 'initialize-with-hyphen': |
||
| 48 | $this->initializeWithHyphen = "false" === (string) $attribute ? false : true; |
||
| 49 | break; |
||
| 50 | case 'page-range-format': |
||
| 51 | $this->pageRangeFormat = new PageRangeFormats((string) $attribute); |
||
| 52 | break; |
||
| 53 | case 'demote-non-dropping-particle': |
||
| 54 | $this->demoteNonDroppingParticles = new DemoteNonDroppingParticle((string) $attribute); |
||
| 55 | } |
||
| 56 | } |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Specifies whether compound given names (e.g. “Jean-Luc”) should be initialized with a hyphen (“J.-L.”, value |
||
| 61 | * “true”, default) or without (“J.L.”, value “false”). |
||
| 62 | * @return bool |
||
|
1 ignored issue
–
show
|
|||
| 63 | */ |
||
| 64 | public function isInitializeWithHyphen() |
||
| 65 | { |
||
| 66 | return $this->initializeWithHyphen; |
||
| 67 | } |
||
| 68 | |||
| 69 | /** |
||
| 70 | * Activates expansion or collapsing of page ranges: “chicago” (“321–28”), “expanded” (e.g. “321–328”), |
||
| 71 | * “minimal” (“321–8”), or “minimal-two” (“321–28”). Delimits page ranges |
||
| 72 | * with the “page-range-delimiter” term (introduced with CSL 1.0.1, and defaults to an en-dash). If the attribute is |
||
| 73 | * not set, page ranges are rendered without reformatting. |
||
| 74 | * @return PageRangeFormats |
||
|
1 ignored issue
–
show
|
|||
| 75 | */ |
||
| 76 | public function getPageRangeFormat() |
||
| 77 | { |
||
| 78 | return $this->pageRangeFormat; |
||
| 79 | } |
||
| 80 | |||
| 81 | /** |
||
| 82 | * Sets the display and sorting behavior of the non-dropping-particle in inverted names (e.g. “Koning, W. de”). |
||
| 83 | * @return DemoteNonDroppingParticle |
||
|
1 ignored issue
–
show
|
|||
| 84 | */ |
||
| 85 | public function getDemoteNonDroppingParticles() |
||
| 88 | } |
||
| 89 | |||
| 90 | } |