Total Complexity | 7 |
Total Lines | 60 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | class Mailcode_Parser_Match |
||
23 | { |
||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $name; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $type; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $params; |
||
38 | |||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | protected $matchedString; |
||
43 | |||
44 | public function __construct(string $name, string $type, string $params, string $matchedString) |
||
45 | { |
||
46 | $this->name = strtolower($name); |
||
47 | $this->type = strtolower($type); |
||
48 | $this->params = trim($params); |
||
49 | $this->matchedString = $matchedString; |
||
50 | |||
51 | $this->applyFilters(); |
||
52 | } |
||
53 | |||
54 | public function getName() : string |
||
55 | { |
||
56 | return $this->name; |
||
57 | } |
||
58 | |||
59 | public function getType() : string |
||
60 | { |
||
61 | return $this->type; |
||
62 | } |
||
63 | |||
64 | public function getParams() : string |
||
67 | } |
||
68 | |||
69 | public function getMatchedString() : string |
||
70 | { |
||
71 | return $this->matchedString; |
||
72 | } |
||
73 | |||
74 | private function applyFilters() : void |
||
75 | { |
||
76 | $this->params = $this->removeNonBreakingSpaces($this->params); |
||
77 | } |
||
78 | |||
79 | private function removeNonBreakingSpaces(string $subject) : string |
||
82 | } |
||
83 | } |
||
84 |