2
2
/**
3
3
* This file is part of PHPWord - A pure PHP library for reading and writing
4
4
* word processing documents.
5
- *
6
5
* PHPWord is free software distributed under the terms of the GNU Lesser
7
6
* General Public License version 3 as published by the Free Software Foundation.
8
- *
9
7
* For the full copyright and license information, please read the LICENSE
10
8
* file that was distributed with this source code. For the full list of
11
9
* contributors, visit https://github.com/PHPOffice/PHPWord/contributors.
12
10
*
13
11
* @see https://github.com/PHPOffice/PHPWord
14
- *
15
12
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
16
13
*/
17
14
@@ -27,158 +24,164 @@ class TextBox extends Image
27
24
/**
28
25
* margin top.
29
26
*
30
- * @var int
27
+ * @var null| int
31
28
*/
32
29
private $ innerMarginTop ;
33
30
34
31
/**
35
32
* margin left.
36
33
*
37
- * @var int
34
+ * @var null| int
38
35
*/
39
36
private $ innerMarginLeft ;
40
37
41
38
/**
42
39
* margin right.
43
40
*
44
- * @var int
41
+ * @var null| int
45
42
*/
46
43
private $ innerMarginRight ;
47
44
48
45
/**
49
46
* Cell margin bottom.
50
47
*
51
- * @var int
48
+ * @var null| int
52
49
*/
53
50
private $ innerMarginBottom ;
54
51
55
52
/**
56
53
* border size.
57
54
*
58
- * @var int
55
+ * @var null| int
59
56
*/
60
57
private $ borderSize ;
61
58
62
59
/**
63
60
* border color.
64
61
*
65
- * @var string
62
+ * @var null| string
66
63
*/
67
64
private $ borderColor ;
68
65
69
66
/**
70
67
* background color.
71
68
*
72
- * @var string
69
+ * @var null| string
73
70
*/
74
71
private $ bgColor ;
75
72
76
73
/**
77
74
* Set background color.
78
75
*
79
- * @param string $value
76
+ * @param null|string $value
77
+ * @return void
80
78
*/
81
- public function setBgColor ($ value = null ): void
79
+ public function setBgColor (string $ value = null ): void
82
80
{
83
81
$ this ->bgColor = $ value ;
84
82
}
85
83
86
84
/**
87
85
* Get background color.
88
86
*
89
- * @return string
87
+ * @return null| string
90
88
*/
91
- public function getBgColor ()
89
+ public function getBgColor (): ? string
92
90
{
93
91
return $ this ->bgColor ;
94
92
}
95
93
96
94
/**
97
95
* Set margin top.
98
96
*
99
- * @param int $value
97
+ * @param null|int $value
98
+ * @return void
100
99
*/
101
- public function setInnerMarginTop ($ value = null ): void
100
+ public function setInnerMarginTop (int $ value = null ): void
102
101
{
103
102
$ this ->innerMarginTop = $ value ;
104
103
}
105
104
106
105
/**
107
106
* Get margin top.
108
107
*
109
- * @return int
108
+ * @return null| int
110
109
*/
111
- public function getInnerMarginTop ()
110
+ public function getInnerMarginTop (): ? int
112
111
{
113
112
return $ this ->innerMarginTop ;
114
113
}
115
114
116
115
/**
117
116
* Set margin left.
118
117
*
119
- * @param int $value
118
+ * @param null|int $value
119
+ * @return void
120
120
*/
121
- public function setInnerMarginLeft ($ value = null ): void
121
+ public function setInnerMarginLeft (int $ value = null ): void
122
122
{
123
123
$ this ->innerMarginLeft = $ value ;
124
124
}
125
125
126
126
/**
127
127
* Get margin left.
128
128
*
129
- * @return int
129
+ * @return null| int
130
130
*/
131
- public function getInnerMarginLeft ()
131
+ public function getInnerMarginLeft (): ? int
132
132
{
133
133
return $ this ->innerMarginLeft ;
134
134
}
135
135
136
136
/**
137
137
* Set margin right.
138
138
*
139
- * @param int $value
139
+ * @param null|int $value
140
+ * @return void
140
141
*/
141
- public function setInnerMarginRight ($ value = null ): void
142
+ public function setInnerMarginRight (int $ value = null ): void
142
143
{
143
144
$ this ->innerMarginRight = $ value ;
144
145
}
145
146
146
147
/**
147
148
* Get margin right.
148
149
*
149
- * @return int
150
+ * @return null| int
150
151
*/
151
- public function getInnerMarginRight ()
152
+ public function getInnerMarginRight (): ? int
152
153
{
153
154
return $ this ->innerMarginRight ;
154
155
}
155
156
156
157
/**
157
158
* Set margin bottom.
158
159
*
159
- * @param int $value
160
+ * @param null|int $value
161
+ * @return void
160
162
*/
161
- public function setInnerMarginBottom ($ value = null ): void
163
+ public function setInnerMarginBottom (int $ value = null ): void
162
164
{
163
165
$ this ->innerMarginBottom = $ value ;
164
166
}
165
167
166
168
/**
167
169
* Get margin bottom.
168
170
*
169
- * @return int
171
+ * @return null| int
170
172
*/
171
- public function getInnerMarginBottom ()
173
+ public function getInnerMarginBottom (): ? int
172
174
{
173
175
return $ this ->innerMarginBottom ;
174
176
}
175
177
176
178
/**
177
179
* Set TLRB cell margin.
178
180
*
179
- * @param int $value Margin in twips
181
+ * @param null|int $value Margin in twips
182
+ * @return void
180
183
*/
181
- public function setInnerMargin ($ value = null ): void
184
+ public function setInnerMargin (int $ value = null ): void
182
185
{
183
186
$ this ->setInnerMarginTop ($ value );
184
187
$ this ->setInnerMarginLeft ($ value );
@@ -191,7 +194,7 @@ public function setInnerMargin($value = null): void
191
194
*
192
195
* @return int[]
193
196
*/
194
- public function getInnerMargin ()
197
+ public function getInnerMargin (): array
195
198
{
196
199
return [$ this ->innerMarginLeft , $ this ->innerMarginTop , $ this ->innerMarginRight , $ this ->innerMarginBottom ];
197
200
}
@@ -201,7 +204,7 @@ public function getInnerMargin()
201
204
*
202
205
* @return bool
203
206
*/
204
- public function hasInnerMargins ()
207
+ public function hasInnerMargins (): bool
205
208
{
206
209
$ hasInnerMargins = false ;
207
210
$ margins = $ this ->getInnerMargin ();
@@ -218,9 +221,10 @@ public function hasInnerMargins()
218
221
/**
219
222
* Set border size.
220
223
*
221
- * @param int $value Size in points
224
+ * @param null|int $value Size in points
225
+ * @return void
222
226
*/
223
- public function setBorderSize ($ value = null ): void
227
+ public function setBorderSize (int $ value = null ): void
224
228
{
225
229
$ this ->borderSize = $ value ;
226
230
}
@@ -230,27 +234,28 @@ public function setBorderSize($value = null): void
230
234
*
231
235
* @return int
232
236
*/
233
- public function getBorderSize ()
237
+ public function getBorderSize (): int
234
238
{
235
239
return $ this ->borderSize ;
236
240
}
237
241
238
242
/**
239
243
* Set border color.
240
244
*
241
- * @param string $value
245
+ * @param null|string $value
246
+ * @return void
242
247
*/
243
- public function setBorderColor ($ value = null ): void
248
+ public function setBorderColor (string $ value = null ): void
244
249
{
245
250
$ this ->borderColor = $ value ;
246
251
}
247
252
248
253
/**
249
254
* Get border color.
250
255
*
251
- * @return string
256
+ * @return null| string
252
257
*/
253
- public function getBorderColor ()
258
+ public function getBorderColor (): ? string
254
259
{
255
260
return $ this ->borderColor ;
256
261
}
0 commit comments