Skip to content

Commit fd95a1c

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into develop
2 parents bde8666 + f711e8a commit fd95a1c

File tree

1 file changed

+63
-32
lines changed

1 file changed

+63
-32
lines changed

Classes/PHPWord/Style/Font.php

+63-32
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
/**
3131
* Class PHPWord_Style_Font
3232
*/
33-
class PHPWord_Style_Font {
34-
33+
class PHPWord_Style_Font
34+
{
3535
const UNDERLINE_NONE = 'none';
3636
const UNDERLINE_DASH = 'dash';
3737
const UNDERLINE_DASHHEAVY = 'dashHeavy';
@@ -170,7 +170,8 @@ class PHPWord_Style_Font {
170170
* @param string $type Type of font
171171
* @param array $paragraphStyle Paragraph styles definition
172172
*/
173-
public function __construct($type = 'text', $paragraphStyle = null) {
173+
public function __construct($type = 'text', $paragraphStyle = null)
174+
{
174175
$this->_type = $type;
175176

176177
if ($paragraphStyle instanceof PHPWord_Style_Paragraph) {
@@ -187,7 +188,8 @@ public function __construct($type = 'text', $paragraphStyle = null) {
187188
* @param array $style
188189
* @return $this
189190
*/
190-
public function setArrayStyle(array $style = array()) {
191+
public function setArrayStyle(array $style = array())
192+
{
191193
foreach ($style as $key => $value) {
192194
if ($key === 'line-height') {
193195
$this->setLineHeight($value);
@@ -207,7 +209,8 @@ public function setArrayStyle(array $style = array()) {
207209
* @param string $key
208210
* @param mixed $value
209211
*/
210-
public function setStyleValue($key, $value) {
212+
public function setStyleValue($key, $value)
213+
{
211214
$method = 'set' . substr($key, 1);
212215
if (method_exists($this, $method)) {
213216
$this->$method($value);
@@ -219,7 +222,8 @@ public function setStyleValue($key, $value) {
219222
*
220223
* @return bool
221224
*/
222-
public function getName() {
225+
public function getName()
226+
{
223227
return $this->_name;
224228
}
225229

@@ -229,21 +233,23 @@ public function getName() {
229233
* @param string $pValue
230234
* @return PHPWord_Style_Font
231235
*/
232-
public function setName($pValue = PHPWord::DEFAULT_FONT_NAME) {
236+
public function setName($pValue = PHPWord::DEFAULT_FONT_NAME)
237+
{
233238
if (is_null($pValue) || $pValue == '') {
234239
$pValue = PHPWord::DEFAULT_FONT_NAME;
235240
}
236241
$this->_name = $pValue;
237242
return $this;
238243
}
239-
244+
240245

241246
/**
242247
* Get font size
243248
*
244249
* @return int|float
245250
*/
246-
public function getSize() {
251+
public function getSize()
252+
{
247253
return $this->_size;
248254
}
249255

@@ -253,7 +259,8 @@ public function getSize() {
253259
* @param int|float $pValue
254260
* @return PHPWord_Style_Font
255261
*/
256-
public function setSize($pValue = PHPWord::DEFAULT_FONT_SIZE) {
262+
public function setSize($pValue = PHPWord::DEFAULT_FONT_SIZE)
263+
{
257264
if (!is_numeric($pValue)) {
258265
$pValue = PHPWord::DEFAULT_FONT_SIZE;
259266
}
@@ -266,7 +273,8 @@ public function setSize($pValue = PHPWord::DEFAULT_FONT_SIZE) {
266273
*
267274
* @return bool
268275
*/
269-
public function getBold() {
276+
public function getBold()
277+
{
270278
return $this->_bold;
271279
}
272280

@@ -276,7 +284,8 @@ public function getBold() {
276284
* @param bool $pValue
277285
* @return PHPWord_Style_Font
278286
*/
279-
public function setBold($pValue = false) {
287+
public function setBold($pValue = false)
288+
{
280289
if (!is_bool($pValue)) {
281290
$pValue = false;
282291
}
@@ -289,7 +298,8 @@ public function setBold($pValue = false) {
289298
*
290299
* @return bool
291300
*/
292-
public function getItalic() {
301+
public function getItalic()
302+
{
293303
return $this->_italic;
294304
}
295305

@@ -299,7 +309,8 @@ public function getItalic() {
299309
* @param bool $pValue
300310
* @return PHPWord_Style_Font
301311
*/
302-
public function setItalic($pValue = false) {
312+
public function setItalic($pValue = false)
313+
{
303314
if (!is_bool($pValue)) {
304315
$pValue = false;
305316
}
@@ -312,7 +323,8 @@ public function setItalic($pValue = false) {
312323
*
313324
* @return bool
314325
*/
315-
public function getSuperScript() {
326+
public function getSuperScript()
327+
{
316328
return $this->_superScript;
317329
}
318330

@@ -322,7 +334,8 @@ public function getSuperScript() {
322334
* @param bool $pValue
323335
* @return PHPWord_Style_Font
324336
*/
325-
public function setSuperScript($pValue = false) {
337+
public function setSuperScript($pValue = false)
338+
{
326339
if (!is_bool($pValue)) {
327340
$pValue = false;
328341
}
@@ -336,7 +349,8 @@ public function setSuperScript($pValue = false) {
336349
*
337350
* @return bool
338351
*/
339-
public function getSubScript() {
352+
public function getSubScript()
353+
{
340354
return $this->_subScript;
341355
}
342356

@@ -346,7 +360,8 @@ public function getSubScript() {
346360
* @param bool $pValue
347361
* @return PHPWord_Style_Font
348362
*/
349-
public function setSubScript($pValue = false) {
363+
public function setSubScript($pValue = false)
364+
{
350365
if (!is_bool($pValue)) {
351366
$pValue = false;
352367
}
@@ -360,7 +375,8 @@ public function setSubScript($pValue = false) {
360375
*
361376
* @return string
362377
*/
363-
public function getUnderline() {
378+
public function getUnderline()
379+
{
364380
return $this->_underline;
365381
}
366382

@@ -370,7 +386,8 @@ public function getUnderline() {
370386
* @param string $pValue
371387
* @return PHPWord_Style_Font
372388
*/
373-
public function setUnderline($pValue = PHPWord_Style_Font::UNDERLINE_NONE) {
389+
public function setUnderline($pValue = PHPWord_Style_Font::UNDERLINE_NONE)
390+
{
374391
if ($pValue == '') {
375392
$pValue = PHPWord_Style_Font::UNDERLINE_NONE;
376393
}
@@ -383,7 +400,8 @@ public function setUnderline($pValue = PHPWord_Style_Font::UNDERLINE_NONE) {
383400
*
384401
* @return bool
385402
*/
386-
public function getStrikethrough() {
403+
public function getStrikethrough()
404+
{
387405
return $this->_strikethrough;
388406
}
389407

@@ -393,7 +411,8 @@ public function getStrikethrough() {
393411
* @param bool $pValue
394412
* @return PHPWord_Style_Font
395413
*/
396-
public function setStrikethrough($pValue = false) {
414+
public function setStrikethrough($pValue = false)
415+
{
397416
if (!is_bool($pValue)) {
398417
$pValue = false;
399418
}
@@ -406,7 +425,8 @@ public function setStrikethrough($pValue = false) {
406425
*
407426
* @return string
408427
*/
409-
public function getColor() {
428+
public function getColor()
429+
{
410430
return $this->_color;
411431
}
412432

@@ -416,7 +436,8 @@ public function getColor() {
416436
* @param string $pValue
417437
* @return PHPWord_Style_Font
418438
*/
419-
public function setColor($pValue = PHPWord::DEFAULT_FONT_COLOR) {
439+
public function setColor($pValue = PHPWord::DEFAULT_FONT_COLOR)
440+
{
420441
if (is_null($pValue) || $pValue == '') {
421442
$pValue = PHPWord::DEFAULT_FONT_COLOR;
422443
}
@@ -429,7 +450,8 @@ public function setColor($pValue = PHPWord::DEFAULT_FONT_COLOR) {
429450
*
430451
* @return bool
431452
*/
432-
public function getFgColor() {
453+
public function getFgColor()
454+
{
433455
return $this->_fgColor;
434456
}
435457

@@ -439,7 +461,8 @@ public function getFgColor() {
439461
* @param string $pValue
440462
* @return PHPWord_Style_Font
441463
*/
442-
public function setFgColor($pValue = null) {
464+
public function setFgColor($pValue = null)
465+
{
443466
$this->_fgColor = $pValue;
444467
return $this;
445468
}
@@ -449,7 +472,8 @@ public function setFgColor($pValue = null) {
449472
*
450473
* @return string
451474
*/
452-
public function getStyleType() {
475+
public function getStyleType()
476+
{
453477
return $this->_type;
454478
}
455479

@@ -458,7 +482,8 @@ public function getStyleType() {
458482
*
459483
* @return PHPWord_Style_Paragraph
460484
*/
461-
public function getParagraphStyle() {
485+
public function getParagraphStyle()
486+
{
462487
return $this->_paragraphStyle;
463488
}
464489

@@ -469,7 +494,8 @@ public function getParagraphStyle() {
469494
* @return $this
470495
* @throws InvalidStyleException
471496
*/
472-
public function setLineHeight($lineHeight) {
497+
public function setLineHeight($lineHeight)
498+
{
473499
if (is_string($lineHeight)) {
474500
$lineHeight = floatval(preg_replace('/[^0-9\.\,]/', '', $lineHeight));
475501
}
@@ -486,24 +512,29 @@ public function setLineHeight($lineHeight) {
486512
/**
487513
* @return int|float
488514
*/
489-
public function getLineHeight() {
515+
public function getLineHeight()
516+
{
490517
return $this->lineHeight;
491518
}
519+
492520
/**
493521
* Get Font Content Type
494522
*
495523
* @return bool
496524
*/
497-
public function getHint() {
525+
public function getHint()
526+
{
498527
return $this->_hint;
499528
}
529+
500530
/**
501531
* Set Font Content Type
502532
*
503533
* @param string $pValue
504534
* @return PHPWord_Style_Font
505535
*/
506-
public function setHint($pValue = PHPWord::DEFAULT_FONT_CONTENT_TYPE) {
536+
public function setHint($pValue = PHPWord::DEFAULT_FONT_CONTENT_TYPE)
537+
{
507538
if (is_null($pValue) || $pValue == '') {
508539
$pValue = PHPWord::DEFAULT_FONT_CONTENT_TYPE;
509540
}

0 commit comments

Comments
 (0)