Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
12 / 12
100.00% covered (success)
100.00%
7 / 7
CRAP
100.00% covered (success)
100.00%
1 / 1
Ruby
100.00% covered (success)
100.00%
12 / 12
100.00% covered (success)
100.00%
7 / 7
7
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 getBaseTextRun
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setBaseTextRun
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getRubyTextRun
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setRubyTextRun
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getProperties
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setProperties
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3/**
4 * This file is part of PHPWord - A pure PHP library for reading and writing
5 * word processing documents.
6 *
7 * PHPWord is free software distributed under the terms of the GNU Lesser
8 * General Public License version 3 as published by the Free Software Foundation.
9 *
10 * For the full copyright and license information, please read the LICENSE
11 * file that was distributed with this source code. For the full list of
12 * contributors, visit https://github.com/PHPOffice/PHPWord/contributors.
13 *
14 * @see         https://github.com/PHPOffice/PHPWord
15 *
16 * @license     http://www.gnu.org/licenses/lgpl.txt LGPL version 3
17 */
18
19namespace PhpOffice\PhpWord\Element;
20
21use PhpOffice\PhpWord\ComplexType\RubyProperties;
22
23/**
24 * Ruby element.
25 *
26 * @see https://learn.microsoft.com/en-us/dotnet/api/documentformat.openxml.wordprocessing.ruby?view=openxml-3.0.1
27 */
28class Ruby extends AbstractElement
29{
30    /**
31     * Ruby properties.
32     *
33     * @var RubyProperties
34     */
35    protected $properties;
36
37    /**
38     * Ruby text run.
39     *
40     * @var TextRun
41     */
42    protected $rubyTextRun;
43
44    /**
45     * Ruby base text run.
46     *
47     * @var TextRun
48     */
49    protected $baseTextRun;
50
51    /**
52     * Create a new Ruby Element.
53     */
54    public function __construct(TextRun $baseTextRun, TextRun $rubyTextRun, RubyProperties $properties)
55    {
56        $this->baseTextRun = $baseTextRun;
57        $this->rubyTextRun = $rubyTextRun;
58        $this->properties = $properties;
59    }
60
61    /**
62     * Get base text run.
63     */
64    public function getBaseTextRun(): TextRun
65    {
66        return $this->baseTextRun;
67    }
68
69    /**
70     * Set the base text run.
71     */
72    public function setBaseTextRun(TextRun $textRun): self
73    {
74        $this->baseTextRun = $textRun;
75
76        return $this;
77    }
78
79    /**
80     * Get ruby text run.
81     */
82    public function getRubyTextRun(): TextRun
83    {
84        return $this->rubyTextRun;
85    }
86
87    /**
88     * Set the ruby text run.
89     */
90    public function setRubyTextRun(TextRun $textRun): self
91    {
92        $this->rubyTextRun = $textRun;
93
94        return $this;
95    }
96
97    /**
98     * Get ruby properties.
99     */
100    public function getProperties(): RubyProperties
101    {
102        return $this->properties;
103    }
104
105    /**
106     * Set the ruby properties.
107     */
108    public function setProperties(RubyProperties $properties): self
109    {
110        $this->properties = $properties;
111
112        return $this;
113    }
114}