Skip to content

Commit b32c198

Browse files
author
Roman Syroeshko
committed
https://github.com/PHPOffice/PHPWord/issues/58
Part II.
1 parent 510f9cd commit b32c198

21 files changed

+602
-635
lines changed

Classes/PHPWord/Style/Cell.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@
2525
* @version 0.8.0
2626
*/
2727

28-
/**
29-
* PHPWord_Style_Cell
30-
*/
31-
class PHPWord_Style_Cell
32-
{
28+
namespace PhpOffice\PhpWord\Style;
3329

30+
class Cell
31+
{
3432
const TEXT_DIR_BTLR = 'btLr';
3533
const TEXT_DIR_TBRL = 'tbRl';
3634

Classes/PHPWord/Style/Font.php

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
32
/**
43
* PHPWord
54
*
@@ -25,12 +24,12 @@
2524
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
2625
* @version 0.8.0
2726
*/
27+
28+
namespace PhpOffice\PhpWord\Style;
29+
2830
use PhpOffice\PhpWord\Exceptions\InvalidStyleException;
2931

30-
/**
31-
* Class PHPWord_Style_Font
32-
*/
33-
class PHPWord_Style_Font
32+
class Font
3433
{
3534
const UNDERLINE_NONE = 'none';
3635
const UNDERLINE_DASH = 'dash';
@@ -76,7 +75,7 @@ class PHPWord_Style_Font
7675
/**
7776
* Paragraph Style
7877
*
79-
* @var PHPWord_Style_Paragraph
78+
* @var PhpOffice\PhpWord\Style\Paragraph
8079
*/
8180
private $_paragraphStyle;
8281

@@ -127,7 +126,7 @@ class PHPWord_Style_Font
127126
*
128127
* @var string
129128
*/
130-
private $_underline = PHPWord_Style_Font::UNDERLINE_NONE;
129+
private $_underline = self::UNDERLINE_NONE;
131130

132131
/**
133132
* Strikethrough
@@ -174,10 +173,10 @@ public function __construct($type = 'text', $paragraphStyle = null)
174173
{
175174
$this->_type = $type;
176175

177-
if ($paragraphStyle instanceof PHPWord_Style_Paragraph) {
176+
if ($paragraphStyle instanceof Paragraph) {
178177
$this->_paragraphStyle = $paragraphStyle;
179178
} elseif (is_array($paragraphStyle)) {
180-
$this->_paragraphStyle = new PHPWord_Style_Paragraph;
179+
$this->_paragraphStyle = new Paragraph;
181180
$this->_paragraphStyle->setArrayStyle($paragraphStyle);
182181
} else {
183182
$this->_paragraphStyle = $paragraphStyle;
@@ -230,8 +229,8 @@ public function getName()
230229
/**
231230
* Set font name
232231
*
233-
* @param string $pValue
234-
* @return PHPWord_Style_Font
232+
* @param string $pValue
233+
* @return PhpOffice\PhpWord\Style\Font
235234
*/
236235
public function setName($pValue = PHPWord::DEFAULT_FONT_NAME)
237236
{
@@ -256,8 +255,8 @@ public function getSize()
256255
/**
257256
* Set font size
258257
*
259-
* @param int|float $pValue
260-
* @return PHPWord_Style_Font
258+
* @param int|float $pValue
259+
* @return PhpOffice\PhpWord\Style\Font
261260
*/
262261
public function setSize($pValue = PHPWord::DEFAULT_FONT_SIZE)
263262
{
@@ -281,8 +280,8 @@ public function getBold()
281280
/**
282281
* Set bold
283282
*
284-
* @param bool $pValue
285-
* @return PHPWord_Style_Font
283+
* @param bool $pValue
284+
* @return PhpOffice\PhpWord\Style\Font
286285
*/
287286
public function setBold($pValue = false)
288287
{
@@ -306,8 +305,8 @@ public function getItalic()
306305
/**
307306
* Set italics
308307
*
309-
* @param bool $pValue
310-
* @return PHPWord_Style_Font
308+
* @param bool $pValue
309+
* @return PhpOffice\PhpWord\Style\Font
311310
*/
312311
public function setItalic($pValue = false)
313312
{
@@ -331,8 +330,8 @@ public function getSuperScript()
331330
/**
332331
* Set superscript
333332
*
334-
* @param bool $pValue
335-
* @return PHPWord_Style_Font
333+
* @param bool $pValue
334+
* @return PhpOffice\PhpWord\Style\Font
336335
*/
337336
public function setSuperScript($pValue = false)
338337
{
@@ -357,8 +356,8 @@ public function getSubScript()
357356
/**
358357
* Set subscript
359358
*
360-
* @param bool $pValue
361-
* @return PHPWord_Style_Font
359+
* @param bool $pValue
360+
* @return PhpOffice\PhpWord\Style\Font
362361
*/
363362
public function setSubScript($pValue = false)
364363
{
@@ -383,13 +382,13 @@ public function getUnderline()
383382
/**
384383
* Set underline
385384
*
386-
* @param string $pValue
387-
* @return PHPWord_Style_Font
385+
* @param string $pValue
386+
* @return PhpOffice\PhpWord\Style\Font
388387
*/
389-
public function setUnderline($pValue = PHPWord_Style_Font::UNDERLINE_NONE)
388+
public function setUnderline($pValue = self::UNDERLINE_NONE)
390389
{
391390
if ($pValue == '') {
392-
$pValue = PHPWord_Style_Font::UNDERLINE_NONE;
391+
$pValue = self::UNDERLINE_NONE;
393392
}
394393
$this->_underline = $pValue;
395394
return $this;
@@ -408,8 +407,8 @@ public function getStrikethrough()
408407
/**
409408
* Set strikethrough
410409
*
411-
* @param bool $pValue
412-
* @return PHPWord_Style_Font
410+
* @param bool $pValue
411+
* @return PhpOffice\PhpWord\Style\Font
413412
*/
414413
public function setStrikethrough($pValue = false)
415414
{
@@ -433,8 +432,8 @@ public function getColor()
433432
/**
434433
* Set font color
435434
*
436-
* @param string $pValue
437-
* @return PHPWord_Style_Font
435+
* @param string $pValue
436+
* @return PhpOffice\PhpWord\Style\Font
438437
*/
439438
public function setColor($pValue = PHPWord::DEFAULT_FONT_COLOR)
440439
{
@@ -458,8 +457,8 @@ public function getFgColor()
458457
/**
459458
* Set foreground/highlight color
460459
*
461-
* @param string $pValue
462-
* @return PHPWord_Style_Font
460+
* @param string $pValue
461+
* @return PhpOffice\PhpWord\Style\Font
463462
*/
464463
public function setFgColor($pValue = null)
465464
{
@@ -480,7 +479,7 @@ public function getStyleType()
480479
/**
481480
* Get paragraph style
482481
*
483-
* @return PHPWord_Style_Paragraph
482+
* @return PhpOffice\PhpWord\Style\Paragraph
484483
*/
485484
public function getParagraphStyle()
486485
{
@@ -530,8 +529,8 @@ public function getHint()
530529
/**
531530
* Set Font Content Type
532531
*
533-
* @param string $pValue
534-
* @return PHPWord_Style_Font
532+
* @param string $pValue
533+
* @return PhpOffice\PhpWord\Style\Font
535534
*/
536535
public function setHint($pValue = PHPWord::DEFAULT_FONT_CONTENT_TYPE)
537536
{

Classes/PHPWord/Style/Image.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@
2525
* @version 0.8.0
2626
*/
2727

28-
/**
29-
* Class PHPWord_Style_Image
30-
*/
31-
class PHPWord_Style_Image
28+
namespace PhpOffice\PhpWord\Style;
29+
30+
class Image
3231
{
3332
const WRAPPING_STYLE_INLINE = 'inline';
3433
const WRAPPING_STYLE_SQUARE = 'square';

Classes/PHPWord/Style/ListItem.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@
2525
* @version 0.8.0
2626
*/
2727

28-
/**
29-
* Class PHPWord_Style_ListItem
30-
*/
31-
class PHPWord_Style_ListItem
32-
{
28+
namespace PhpOffice\PhpWord\Style;
3329

30+
class ListItem
31+
{
3432
const TYPE_NUMBER = 7;
3533
const TYPE_NUMBER_NESTED = 8;
3634
const TYPE_ALPHANUM = 9;
@@ -48,7 +46,7 @@ class PHPWord_Style_ListItem
4846
*/
4947
public function __construct()
5048
{
51-
$this->_listType = PHPWord_Style_ListItem::TYPE_BULLET_FILLED;
49+
$this->_listType = self::TYPE_BULLET_FILLED;
5250
}
5351

5452
/**
@@ -67,7 +65,7 @@ public function setStyleValue($key, $value)
6765
*
6866
* @param int $pValue
6967
*/
70-
public function setListType($pValue = PHPWord_Style_ListItem::TYPE_BULLET_FILLED)
68+
public function setListType($pValue = self::TYPE_BULLET_FILLED)
7169
{
7270
$this->_listType = $pValue;
7371
}

0 commit comments

Comments
 (0)