WordTree::setFormat()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 10
1
<?php
2
3
namespace CMEN\GoogleChartsBundle\GoogleCharts\Options\WordTree;
4
5
/**
6
 * @author Christophe Meneses
7
 */
8
class WordTree
9
{
10
    /**
11
     * If implicit, the input text will be split into sentences and words, and displayed according to frequency.
12
     * If explicit, words and their connections are specified directly.
13
     *
14
     * @var string
15
     */
16
    protected $format;
17
18
    /**
19
     * For implicit word trees, the regular expression to use to break the text into sentences. The sentences are then
20
     * broken into words using the wordRegex option.
21
     *
22
     * @var string
23
     */
24
    protected $sentenceRegex;
25
26
    /**
27
     * Whether the word tree is a prefix tree (root word on the right), a suffix tree (left), or double tree (middle).
28
     *
29
     * @var string
30
     */
31
    protected $type;
32
33
    /**
34
     * For implicit word trees, which word to use as the root of the tree. (Note that word trees are case sensitive.)
35
     * This option must be specified for double word trees.
36
     *
37
     * @var string
38
     */
39
    protected $word;
40
41
    /**
42
     * For implicit word trees, the regular expression to use to break sentences into individual words to be displayed.
43
     *
44
     * @var string
45
     */
46
    protected $wordRegex;
47
48
    /**
49
     * @return $this
50
     */
51
    public function setFormat(string $format)
52
    {
53
        $this->format = $format;
54
55
        return $this;
56
    }
57
58
    /**
59
     * @return $this
60
     */
61
    public function setSentenceRegex(string $sentenceRegex)
62
    {
63
        $this->sentenceRegex = $sentenceRegex;
64
65
        return $this;
66
    }
67
68
    /**
69
     * @return $this
70
     */
71
    public function setType(string $type)
72
    {
73
        $this->type = $type;
74
75
        return $this;
76
    }
77
78
    /**
79
     * @return $this
80
     */
81
    public function setWord(string $word)
82
    {
83
        $this->word = $word;
84
85
        return $this;
86
    }
87
88
    /**
89
     * @return $this
90
     */
91
    public function setWordRegex(string $wordRegex)
92
    {
93
        $this->wordRegex = $wordRegex;
94
95
        return $this;
96
    }
97
}
98