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