30
30
/**
31
31
* Class PHPWord_Style_Font
32
32
*/
33
- class PHPWord_Style_Font {
34
-
33
+ class PHPWord_Style_Font
34
+ {
35
35
const UNDERLINE_NONE = 'none ' ;
36
36
const UNDERLINE_DASH = 'dash ' ;
37
37
const UNDERLINE_DASHHEAVY = 'dashHeavy ' ;
@@ -170,7 +170,8 @@ class PHPWord_Style_Font {
170
170
* @param string $type Type of font
171
171
* @param array $paragraphStyle Paragraph styles definition
172
172
*/
173
- public function __construct ($ type = 'text ' , $ paragraphStyle = null ) {
173
+ public function __construct ($ type = 'text ' , $ paragraphStyle = null )
174
+ {
174
175
$ this ->_type = $ type ;
175
176
176
177
if ($ paragraphStyle instanceof PHPWord_Style_Paragraph) {
@@ -189,7 +190,8 @@ public function __construct($type = 'text', $paragraphStyle = null) {
189
190
* @param array $style
190
191
* @return $this
191
192
*/
192
- public function setArrayStyle (array $ style = array ()) {
193
+ public function setArrayStyle (array $ style = array ())
194
+ {
193
195
foreach ($ style as $ key => $ value ) {
194
196
if ($ key === 'line-height ' ) {
195
197
$ this ->setLineHeight ($ value );
@@ -209,7 +211,8 @@ public function setArrayStyle(array $style = array()) {
209
211
* @param string $key
210
212
* @param mixed $value
211
213
*/
212
- public function setStyleValue ($ key , $ value ) {
214
+ public function setStyleValue ($ key , $ value )
215
+ {
213
216
$ method = 'set ' . substr ($ key , 1 );
214
217
if (method_exists ($ this , $ method )) {
215
218
$ this ->$ method ($ value );
@@ -221,7 +224,8 @@ public function setStyleValue($key, $value) {
221
224
*
222
225
* @return bool
223
226
*/
224
- public function getName () {
227
+ public function getName ()
228
+ {
225
229
return $ this ->_name ;
226
230
}
227
231
@@ -231,21 +235,23 @@ public function getName() {
231
235
* @param string $pValue
232
236
* @return PHPWord_Style_Font
233
237
*/
234
- public function setName ($ pValue = PHPWord::DEFAULT_FONT_NAME ) {
238
+ public function setName ($ pValue = PHPWord::DEFAULT_FONT_NAME )
239
+ {
235
240
if (is_null ($ pValue ) || $ pValue == '' ) {
236
241
$ pValue = PHPWord::DEFAULT_FONT_NAME ;
237
242
}
238
243
$ this ->_name = $ pValue ;
239
244
return $ this ;
240
245
}
241
-
246
+
242
247
243
248
/**
244
249
* Get font size
245
250
*
246
251
* @return int|float
247
252
*/
248
- public function getSize () {
253
+ public function getSize ()
254
+ {
249
255
return $ this ->_size ;
250
256
}
251
257
@@ -255,7 +261,8 @@ public function getSize() {
255
261
* @param int|float $pValue
256
262
* @return PHPWord_Style_Font
257
263
*/
258
- public function setSize ($ pValue = PHPWord::DEFAULT_FONT_SIZE ) {
264
+ public function setSize ($ pValue = PHPWord::DEFAULT_FONT_SIZE )
265
+ {
259
266
if (!is_numeric ($ pValue )) {
260
267
$ pValue = PHPWord::DEFAULT_FONT_SIZE ;
261
268
}
@@ -268,7 +275,8 @@ public function setSize($pValue = PHPWord::DEFAULT_FONT_SIZE) {
268
275
*
269
276
* @return bool
270
277
*/
271
- public function getBold () {
278
+ public function getBold ()
279
+ {
272
280
return $ this ->_bold ;
273
281
}
274
282
@@ -278,7 +286,8 @@ public function getBold() {
278
286
* @param bool $pValue
279
287
* @return PHPWord_Style_Font
280
288
*/
281
- public function setBold ($ pValue = false ) {
289
+ public function setBold ($ pValue = false )
290
+ {
282
291
if (!is_bool ($ pValue )) {
283
292
$ pValue = false ;
284
293
}
@@ -291,7 +300,8 @@ public function setBold($pValue = false) {
291
300
*
292
301
* @return bool
293
302
*/
294
- public function getItalic () {
303
+ public function getItalic ()
304
+ {
295
305
return $ this ->_italic ;
296
306
}
297
307
@@ -301,7 +311,8 @@ public function getItalic() {
301
311
* @param bool $pValue
302
312
* @return PHPWord_Style_Font
303
313
*/
304
- public function setItalic ($ pValue = false ) {
314
+ public function setItalic ($ pValue = false )
315
+ {
305
316
if (!is_bool ($ pValue )) {
306
317
$ pValue = false ;
307
318
}
@@ -314,7 +325,8 @@ public function setItalic($pValue = false) {
314
325
*
315
326
* @return bool
316
327
*/
317
- public function getSuperScript () {
328
+ public function getSuperScript ()
329
+ {
318
330
return $ this ->_superScript ;
319
331
}
320
332
@@ -324,7 +336,8 @@ public function getSuperScript() {
324
336
* @param bool $pValue
325
337
* @return PHPWord_Style_Font
326
338
*/
327
- public function setSuperScript ($ pValue = false ) {
339
+ public function setSuperScript ($ pValue = false )
340
+ {
328
341
if (!is_bool ($ pValue )) {
329
342
$ pValue = false ;
330
343
}
@@ -338,7 +351,8 @@ public function setSuperScript($pValue = false) {
338
351
*
339
352
* @return bool
340
353
*/
341
- public function getSubScript () {
354
+ public function getSubScript ()
355
+ {
342
356
return $ this ->_subScript ;
343
357
}
344
358
@@ -348,7 +362,8 @@ public function getSubScript() {
348
362
* @param bool $pValue
349
363
* @return PHPWord_Style_Font
350
364
*/
351
- public function setSubScript ($ pValue = false ) {
365
+ public function setSubScript ($ pValue = false )
366
+ {
352
367
if (!is_bool ($ pValue )) {
353
368
$ pValue = false ;
354
369
}
@@ -362,7 +377,8 @@ public function setSubScript($pValue = false) {
362
377
*
363
378
* @return string
364
379
*/
365
- public function getUnderline () {
380
+ public function getUnderline ()
381
+ {
366
382
return $ this ->_underline ;
367
383
}
368
384
@@ -372,7 +388,8 @@ public function getUnderline() {
372
388
* @param string $pValue
373
389
* @return PHPWord_Style_Font
374
390
*/
375
- public function setUnderline ($ pValue = PHPWord_Style_Font::UNDERLINE_NONE ) {
391
+ public function setUnderline ($ pValue = PHPWord_Style_Font::UNDERLINE_NONE )
392
+ {
376
393
if ($ pValue == '' ) {
377
394
$ pValue = PHPWord_Style_Font::UNDERLINE_NONE ;
378
395
}
@@ -385,7 +402,8 @@ public function setUnderline($pValue = PHPWord_Style_Font::UNDERLINE_NONE) {
385
402
*
386
403
* @return bool
387
404
*/
388
- public function getStrikethrough () {
405
+ public function getStrikethrough ()
406
+ {
389
407
return $ this ->_strikethrough ;
390
408
}
391
409
@@ -395,7 +413,8 @@ public function getStrikethrough() {
395
413
* @param bool $pValue
396
414
* @return PHPWord_Style_Font
397
415
*/
398
- public function setStrikethrough ($ pValue = false ) {
416
+ public function setStrikethrough ($ pValue = false )
417
+ {
399
418
if (!is_bool ($ pValue )) {
400
419
$ pValue = false ;
401
420
}
@@ -408,7 +427,8 @@ public function setStrikethrough($pValue = false) {
408
427
*
409
428
* @return string
410
429
*/
411
- public function getColor () {
430
+ public function getColor ()
431
+ {
412
432
return $ this ->_color ;
413
433
}
414
434
@@ -418,7 +438,8 @@ public function getColor() {
418
438
* @param string $pValue
419
439
* @return PHPWord_Style_Font
420
440
*/
421
- public function setColor ($ pValue = PHPWord::DEFAULT_FONT_COLOR ) {
441
+ public function setColor ($ pValue = PHPWord::DEFAULT_FONT_COLOR )
442
+ {
422
443
if (is_null ($ pValue ) || $ pValue == '' ) {
423
444
$ pValue = PHPWord::DEFAULT_FONT_COLOR ;
424
445
}
@@ -431,7 +452,8 @@ public function setColor($pValue = PHPWord::DEFAULT_FONT_COLOR) {
431
452
*
432
453
* @return bool
433
454
*/
434
- public function getFgColor () {
455
+ public function getFgColor ()
456
+ {
435
457
return $ this ->_fgColor ;
436
458
}
437
459
@@ -441,7 +463,8 @@ public function getFgColor() {
441
463
* @param string $pValue
442
464
* @return PHPWord_Style_Font
443
465
*/
444
- public function setFgColor ($ pValue = null ) {
466
+ public function setFgColor ($ pValue = null )
467
+ {
445
468
$ this ->_fgColor = $ pValue ;
446
469
return $ this ;
447
470
}
@@ -451,7 +474,8 @@ public function setFgColor($pValue = null) {
451
474
*
452
475
* @return string
453
476
*/
454
- public function getStyleType () {
477
+ public function getStyleType ()
478
+ {
455
479
return $ this ->_type ;
456
480
}
457
481
@@ -460,7 +484,8 @@ public function getStyleType() {
460
484
*
461
485
* @return PHPWord_Style_Paragraph
462
486
*/
463
- public function getParagraphStyle () {
487
+ public function getParagraphStyle ()
488
+ {
464
489
return $ this ->_paragraphStyle ;
465
490
}
466
491
@@ -471,7 +496,8 @@ public function getParagraphStyle() {
471
496
* @return $this
472
497
* @throws InvalidStyleException
473
498
*/
474
- public function setLineHeight ($ lineHeight ) {
499
+ public function setLineHeight ($ lineHeight )
500
+ {
475
501
if (is_string ($ lineHeight )) {
476
502
$ lineHeight = floatval (preg_replace ('/[^0-9\.\,]/ ' , '' , $ lineHeight ));
477
503
}
@@ -488,24 +514,29 @@ public function setLineHeight($lineHeight) {
488
514
/**
489
515
* @return int|float
490
516
*/
491
- public function getLineHeight () {
517
+ public function getLineHeight ()
518
+ {
492
519
return $ this ->lineHeight ;
493
520
}
521
+
494
522
/**
495
523
* Get Font Content Type
496
524
*
497
525
* @return bool
498
526
*/
499
- public function getHint () {
527
+ public function getHint ()
528
+ {
500
529
return $ this ->_hint ;
501
530
}
531
+
502
532
/**
503
533
* Set Font Content Type
504
534
*
505
535
* @param string $pValue
506
536
* @return PHPWord_Style_Font
507
537
*/
508
- public function setHint ($ pValue = PHPWord::DEFAULT_FONT_CONTENT_TYPE ) {
538
+ public function setHint ($ pValue = PHPWord::DEFAULT_FONT_CONTENT_TYPE )
539
+ {
509
540
if (is_null ($ pValue ) || $ pValue == '' ) {
510
541
$ pValue = PHPWord::DEFAULT_FONT_CONTENT_TYPE ;
511
542
}
0 commit comments