Total Complexity | 9 |
Total Lines | 65 |
Duplicated Lines | 0 % |
Changes | 4 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | trait Mailcode_Traits_Commands_ProtectedContent |
||
11 | { |
||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | protected string $content = ''; |
||
16 | |||
17 | public function getContent() : string |
||
18 | { |
||
19 | return $this->content; |
||
20 | } |
||
21 | |||
22 | public function getContentTrimmed() : string |
||
23 | { |
||
24 | return trim($this->content); |
||
25 | } |
||
26 | |||
27 | protected ?Mailcode_Parser_Statement_Tokenizer_Token_Number $contentIDToken = null; |
||
28 | |||
29 | public function getContentIDToken() : ?Mailcode_Parser_Statement_Tokenizer_Token_Number |
||
30 | { |
||
31 | return $this->contentIDToken; |
||
32 | } |
||
33 | |||
34 | protected function validateSyntax_content_id() : void |
||
50 | ); |
||
51 | } |
||
52 | |||
53 | public function getContentID() : int |
||
54 | { |
||
55 | if(isset($this->contentIDToken)) |
||
56 | { |
||
57 | return (int)$this->contentIDToken->getValue(); |
||
58 | } |
||
59 | |||
60 | return 0; |
||
61 | } |
||
62 | |||
63 | private function loadContent() : void |
||
64 | { |
||
65 | $contentID = $this->getContentID(); |
||
66 | |||
67 | $this->content = Mailcode_Parser_PreParser::getContent($contentID); |
||
68 | |||
69 | Mailcode_Parser_PreParser::clearContent($contentID); |
||
70 | } |
||
71 | |||
72 | public function getNormalized() : string |
||
75 | } |
||
76 | } |
||
77 |