Lines Matching refs:this

14     /** @var  string The type of node that this is */
20 /** @var string For text nodes, this contains the node's text content. */
23 /** @var Mark[] The marks (things like whether it is emphasized or part of a link) associated with this node */
36 $this->type = $type;
38 $this->setText('');
47 if ($this->type == 'text') {
50 $this->content[] = $child;
58 $this->marks[] = $mark;
66 return $this->type;
74 return $this->text;
82 if ($this->type != 'text') {
85 $this->text = $text;
92 * @return $this|mixed Either the wanted value or the Node itself
97 if (isset($this->attrs[$key])) {
98 return $this->attrs[$key];
104 $this->attrs[$key] = $value;
105 return $this;
119 'type' => $this->type,
121 if ($this->type == 'text') {
122 $json['text'] = $this->text;
123 } elseif ($this->content) {
124 $json['content'] = $this->content;
127 if ($this->marks) {
128 $json['marks'] = $this->marks;
130 if ($this->attrs) {
131 $json['attrs'] = $this->attrs;
138 * Check if any child nodes have been added to this node
143 return !empty($this->content);
147 * Trim all whitespace from the beginning of this node's content
149 * If this is a text-node then this node's text is left-trimmed
156 if ($this->hasContent()) {
157 $this->content[0]->trimContentLeft();
158 if ($this->content[0]->getText() === '') {
159 array_shift($this->content);
163 if ($this->text !== null) {
164 $this->text = ltrim($this->text);
169 * Trim all whitespace from the end of this node's content
171 * If this is a text-node then this node's text is right-trimmed
178 if ($this->hasContent()) {
179 $contentLength = count($this->content) - 1;
180 $this->content[$contentLength]->trimContentRight();
181 if ($this->content[$contentLength]->getText() === '') {
182 array_pop($this->content);
186 if ($this->text !== null) {
187 $this->text = rtrim($this->text);