PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.4.8
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.4.8
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
visualizer / vendor / phpoffice / phpspreadsheet / src / PhpSpreadsheet / RichText / TextElement.php

TextElement.php in Visualizer – Tables & Charts Manager with Built-in AI Generator 3.4.8, at vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/TextElement.php

87 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace PhpOffice\PhpSpreadsheet\RichText;
4
5 class TextElement implements ITextElement
6 {
7 /**
8 * Text.
9 *
10 * @var string
11 */
12 private $text;
13
14 /**
15 * Create a new TextElement instance.
16 *
17 * @param string $pText Text
18 */
19 public function __construct($pText = '')
20 {
21 // Initialise variables
22 $this->text = $pText;
23 }
24
25 /**
26 * Get text.
27 *
28 * @return string Text
29 */
30 public function getText()
31 {
32 return $this->text;
33 }
34
35 /**
36 * Set text.
37 *
38 * @param $text string Text
39 *
40 * @return ITextElement
41 */
42 public function setText($text)
43 {
44 $this->text = $text;
45
46 return $this;
47 }
48
49 /**
50 * Get font.
51 *
52 * @return null|\PhpOffice\PhpSpreadsheet\Style\Font
53 */
54 public function getFont()
55 {
56 return null;
57 }
58
59 /**
60 * Get hash code.
61 *
62 * @return string Hash code
63 */
64 public function getHashCode()
65 {
66 return md5(
67 $this->text .
68 __CLASS__
69 );
70 }
71
72 /**
73 * Implement PHP __clone to create a deep clone, not just a shallow copy.
74 */
75 public function __clone()
76 {
77 $vars = get_object_vars($this);
78 foreach ($vars as $key => $value) {
79 if (is_object($value)) {
80 $this->$key = clone $value;
81 } else {
82 $this->$key = $value;
83 }
84 }
85 }
86 }
87