Skip to content

Commit f711e8a

Browse files
committed
Formatted code in PHPWord_Style_Font class
1 parent 1dcd267 commit f711e8a

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) {
@@ -189,7 +190,8 @@ public function __construct($type = 'text', $paragraphStyle = null) {
189190
* @param array $style
190191
* @return $this
191192
*/
192-
public function setArrayStyle(array $style = array()) {
193+
public function setArrayStyle(array $style = array())
194+
{
193195
foreach ($style as $key => $value) {
194196
if ($key === 'line-height') {
195197
$this->setLineHeight($value);
@@ -209,7 +211,8 @@ public function setArrayStyle(array $style = array()) {
209211
* @param string $key
210212
* @param mixed $value
211213
*/
212-
public function setStyleValue($key, $value) {
214+
public function setStyleValue($key, $value)
215+
{
213216
$method = 'set' . substr($key, 1);
214217
if (method_exists($this, $method)) {
215218
$this->$method($value);
@@ -221,7 +224,8 @@ public function setStyleValue($key, $value) {
221224
*
222225
* @return bool
223226
*/
224-
public function getName() {
227+
public function getName()
228+
{
225229
return $this->_name;
226230
}
227231

@@ -231,21 +235,23 @@ public function getName() {
231235
* @param string $pValue
232236
* @return PHPWord_Style_Font
233237
*/
234-
public function setName($pValue = PHPWord::DEFAULT_FONT_NAME) {
238+
public function setName($pValue = PHPWord::DEFAULT_FONT_NAME)
239+
{
235240
if (is_null($pValue) || $pValue == '') {
236241
$pValue = PHPWord::DEFAULT_FONT_NAME;
237242
}
238243
$this->_name = $pValue;
239244
return $this;
240245
}
241-
246+
242247

243248
/**
244249
* Get font size
245250
*
246251
* @return int|float
247252
*/
248-
public function getSize() {
253+
public function getSize()
254+
{
249255
return $this->_size;
250256
}
251257

@@ -255,7 +261,8 @@ public function getSize() {
255261
* @param int|float $pValue
256262
* @return PHPWord_Style_Font
257263
*/
258-
public function setSize($pValue = PHPWord::DEFAULT_FONT_SIZE) {
264+
public function setSize($pValue = PHPWord::DEFAULT_FONT_SIZE)
265+
{
259266
if (!is_numeric($pValue)) {
260267
$pValue = PHPWord::DEFAULT_FONT_SIZE;
261268
}
@@ -268,7 +275,8 @@ public function setSize($pValue = PHPWord::DEFAULT_FONT_SIZE) {
268275
*
269276
* @return bool
270277
*/
271-
public function getBold() {
278+
public function getBold()
279+
{
272280
return $this->_bold;
273281
}
274282

@@ -278,7 +286,8 @@ public function getBold() {
278286
* @param bool $pValue
279287
* @return PHPWord_Style_Font
280288
*/
281-
public function setBold($pValue = false) {
289+
public function setBold($pValue = false)
290+
{
282291
if (!is_bool($pValue)) {
283292
$pValue = false;
284293
}
@@ -291,7 +300,8 @@ public function setBold($pValue = false) {
291300
*
292301
* @return bool
293302
*/
294-
public function getItalic() {
303+
public function getItalic()
304+
{
295305
return $this->_italic;
296306
}
297307

@@ -301,7 +311,8 @@ public function getItalic() {
301311
* @param bool $pValue
302312
* @return PHPWord_Style_Font
303313
*/
304-
public function setItalic($pValue = false) {
314+
public function setItalic($pValue = false)
315+
{
305316
if (!is_bool($pValue)) {
306317
$pValue = false;
307318
}
@@ -314,7 +325,8 @@ public function setItalic($pValue = false) {
314325
*
315326
* @return bool
316327
*/
317-
public function getSuperScript() {
328+
public function getSuperScript()
329+
{
318330
return $this->_superScript;
319331
}
320332

@@ -324,7 +336,8 @@ public function getSuperScript() {
324336
* @param bool $pValue
325337
* @return PHPWord_Style_Font
326338
*/
327-
public function setSuperScript($pValue = false) {
339+
public function setSuperScript($pValue = false)
340+
{
328341
if (!is_bool($pValue)) {
329342
$pValue = false;
330343
}
@@ -338,7 +351,8 @@ public function setSuperScript($pValue = false) {
338351
*
339352
* @return bool
340353
*/
341-
public function getSubScript() {
354+
public function getSubScript()
355+
{
342356
return $this->_subScript;
343357
}
344358

@@ -348,7 +362,8 @@ public function getSubScript() {
348362
* @param bool $pValue
349363
* @return PHPWord_Style_Font
350364
*/
351-
public function setSubScript($pValue = false) {
365+
public function setSubScript($pValue = false)
366+
{
352367
if (!is_bool($pValue)) {
353368
$pValue = false;
354369
}
@@ -362,7 +377,8 @@ public function setSubScript($pValue = false) {
362377
*
363378
* @return string
364379
*/
365-
public function getUnderline() {
380+
public function getUnderline()
381+
{
366382
return $this->_underline;
367383
}
368384

@@ -372,7 +388,8 @@ public function getUnderline() {
372388
* @param string $pValue
373389
* @return PHPWord_Style_Font
374390
*/
375-
public function setUnderline($pValue = PHPWord_Style_Font::UNDERLINE_NONE) {
391+
public function setUnderline($pValue = PHPWord_Style_Font::UNDERLINE_NONE)
392+
{
376393
if ($pValue == '') {
377394
$pValue = PHPWord_Style_Font::UNDERLINE_NONE;
378395
}
@@ -385,7 +402,8 @@ public function setUnderline($pValue = PHPWord_Style_Font::UNDERLINE_NONE) {
385402
*
386403
* @return bool
387404
*/
388-
public function getStrikethrough() {
405+
public function getStrikethrough()
406+
{
389407
return $this->_strikethrough;
390408
}
391409

@@ -395,7 +413,8 @@ public function getStrikethrough() {
395413
* @param bool $pValue
396414
* @return PHPWord_Style_Font
397415
*/
398-
public function setStrikethrough($pValue = false) {
416+
public function setStrikethrough($pValue = false)
417+
{
399418
if (!is_bool($pValue)) {
400419
$pValue = false;
401420
}
@@ -408,7 +427,8 @@ public function setStrikethrough($pValue = false) {
408427
*
409428
* @return string
410429
*/
411-
public function getColor() {
430+
public function getColor()
431+
{
412432
return $this->_color;
413433
}
414434

@@ -418,7 +438,8 @@ public function getColor() {
418438
* @param string $pValue
419439
* @return PHPWord_Style_Font
420440
*/
421-
public function setColor($pValue = PHPWord::DEFAULT_FONT_COLOR) {
441+
public function setColor($pValue = PHPWord::DEFAULT_FONT_COLOR)
442+
{
422443
if (is_null($pValue) || $pValue == '') {
423444
$pValue = PHPWord::DEFAULT_FONT_COLOR;
424445
}
@@ -431,7 +452,8 @@ public function setColor($pValue = PHPWord::DEFAULT_FONT_COLOR) {
431452
*
432453
* @return bool
433454
*/
434-
public function getFgColor() {
455+
public function getFgColor()
456+
{
435457
return $this->_fgColor;
436458
}
437459

@@ -441,7 +463,8 @@ public function getFgColor() {
441463
* @param string $pValue
442464
* @return PHPWord_Style_Font
443465
*/
444-
public function setFgColor($pValue = null) {
466+
public function setFgColor($pValue = null)
467+
{
445468
$this->_fgColor = $pValue;
446469
return $this;
447470
}
@@ -451,7 +474,8 @@ public function setFgColor($pValue = null) {
451474
*
452475
* @return string
453476
*/
454-
public function getStyleType() {
477+
public function getStyleType()
478+
{
455479
return $this->_type;
456480
}
457481

@@ -460,7 +484,8 @@ public function getStyleType() {
460484
*
461485
* @return PHPWord_Style_Paragraph
462486
*/
463-
public function getParagraphStyle() {
487+
public function getParagraphStyle()
488+
{
464489
return $this->_paragraphStyle;
465490
}
466491

@@ -471,7 +496,8 @@ public function getParagraphStyle() {
471496
* @return $this
472497
* @throws InvalidStyleException
473498
*/
474-
public function setLineHeight($lineHeight) {
499+
public function setLineHeight($lineHeight)
500+
{
475501
if (is_string($lineHeight)) {
476502
$lineHeight = floatval(preg_replace('/[^0-9\.\,]/', '', $lineHeight));
477503
}
@@ -488,24 +514,29 @@ public function setLineHeight($lineHeight) {
488514
/**
489515
* @return int|float
490516
*/
491-
public function getLineHeight() {
517+
public function getLineHeight()
518+
{
492519
return $this->lineHeight;
493520
}
521+
494522
/**
495523
* Get Font Content Type
496524
*
497525
* @return bool
498526
*/
499-
public function getHint() {
527+
public function getHint()
528+
{
500529
return $this->_hint;
501530
}
531+
502532
/**
503533
* Set Font Content Type
504534
*
505535
* @param string $pValue
506536
* @return PHPWord_Style_Font
507537
*/
508-
public function setHint($pValue = PHPWord::DEFAULT_FONT_CONTENT_TYPE) {
538+
public function setHint($pValue = PHPWord::DEFAULT_FONT_CONTENT_TYPE)
539+
{
509540
if (is_null($pValue) || $pValue == '') {
510541
$pValue = PHPWord::DEFAULT_FONT_CONTENT_TYPE;
511542
}

0 commit comments

Comments
 (0)