PluginProbe
TablePress – Tables in WordPress made easy / 3.4
TablePress – Tables in WordPress made easy v3.4
3.4 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 All 45 releases
tablepress / libraries / vendor / PhpSpreadsheet / RichText / TextElement.php

TextElement.php in TablePress – Tables in WordPress made easy 3.4, at libraries/vendor/PhpSpreadsheet/RichText/TextElement.php

70 lines 965 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace TablePress\PhpOffice\PhpSpreadsheet\RichText;
4
5 use TablePress\PhpOffice\PhpSpreadsheet\Style\Font;
6
7 class TextElement implements ITextElement
8 {
9 /**
10 * Text.
11 */
12 private string $text;
13
14 /**
15 * Create a new TextElement instance.
16 *
17 * @param string $text Text
18 */
19 public function __construct(string $text = '')
20 {
21 // Initialise variables
22 $this->text = $text;
23 }
24
25 /**
26 * Get text.
27 *
28 * @return string Text
29 */
30 public function getText(): string
31 {
32 return $this->text;
33 }
34
35 /**
36 * Set text.
37 *
38 * @param string $text Text
39 *
40 * @return $this
41 */
42 public function setText(string $text): self
43 {
44 $this->text = $text;
45
46 return $this;
47 }
48
49 /**
50 * Get font. For this class, the return value is always null.
51 */
52 public function getFont(): ?Font
53 {
54 return null;
55 }
56
57 /**
58 * Get hash code.
59 *
60 * @return string Hash code
61 */
62 public function getHashCode(): string
63 {
64 return md5(
65 $this->text
66 . __CLASS__
67 );
68 }
69 }
70