Skip to content

Commit 82f3a2a

Browse files
hultbergtroosan
authored andcommitted
Update documentation for Style::add*Style methods (PHPOffice#1383)
* Update documentation for Style::add*Style methods * remove phpDocumentor, simplify dependencies
1 parent e02c5f7 commit 82f3a2a

File tree

6 files changed

+19
-20
lines changed

6 files changed

+19
-20
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ before_script:
3737
- composer self-update
3838
- travis_wait composer install --prefer-source
3939
## PHPDocumentor
40-
- mkdir -p build/docs
40+
##- mkdir -p build/docs
4141
- mkdir -p build/coverage
4242

4343
script:
@@ -52,7 +52,7 @@ script:
5252
## PHPLOC
5353
- if [ -z "$COVERAGE" ]; then ./vendor/bin/phploc src/ ; fi
5454
## PHPDocumentor
55-
- if [ -z "$COVERAGE" ]; then ./vendor/bin/phpdoc -q -d ./src -t ./build/docs --ignore "*/src/PhpWord/Shared/*/*" --template="responsive-twig" ; fi
55+
##- if [ -z "$COVERAGE" ]; then ./vendor/bin/phpdoc -q -d ./src -t ./build/docs --ignore "*/src/PhpWord/Shared/*/*" --template="responsive-twig" ; fi
5656

5757
after_success:
5858
## Coveralls

composer.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,13 @@
6565
},
6666
"require-dev": {
6767
"phpunit/phpunit": "^4.8.36 || ^5.0",
68-
"phpdocumentor/phpdocumentor":"2.*",
69-
"squizlabs/php_codesniffer": "^2.7",
70-
"friendsofphp/php-cs-fixer": "^2.0",
68+
"squizlabs/php_codesniffer": "^2.9",
69+
"friendsofphp/php-cs-fixer": "^2.2",
7170
"phpmd/phpmd": "2.*",
7271
"phploc/phploc": "2.* || 3.* || 4.*",
7372
"dompdf/dompdf":"0.8.*",
7473
"tecnickcom/tcpdf": "6.*",
75-
"mpdf/mpdf": "5.* || 6.* || 7.*",
74+
"mpdf/mpdf": "5.7.4 || 6.* || 7.*",
7675
"php-coveralls/php-coveralls": "1.1.0 || ^2.0"
7776
},
7877
"suggest": {

src/PhpWord/Element/AbstractElement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ public function getParent()
347347
*
348348
* @param \PhpOffice\PhpWord\Element\AbstractElement $container
349349
*/
350-
public function setParentContainer(AbstractElement $container)
350+
public function setParentContainer(self $container)
351351
{
352352
$this->parentContainer = substr(get_class($container), strrpos(get_class($container), '\\') + 1);
353353
$this->parent = $container;

src/PhpWord/PhpWord.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
* @method int addChart(Element\Chart $chart)
3636
* @method int addComment(Element\Comment $comment)
3737
*
38-
* @method Style\Paragraph addParagraphStyle(string $styleName, array $styles)
38+
* @method Style\Paragraph addParagraphStyle(string $styleName, mixed $styles)
3939
* @method Style\Font addFontStyle(string $styleName, mixed $fontStyle, mixed $paragraphStyle = null)
4040
* @method Style\Font addLinkStyle(string $styleName, mixed $styles)
41-
* @method Style\Font addTitleStyle(int $depth, mixed $fontStyle, mixed $paragraphStyle = null)
41+
* @method Style\Font addTitleStyle(mixed $depth, mixed $fontStyle, mixed $paragraphStyle = null)
4242
* @method Style\Table addTableStyle(string $styleName, mixed $styleTable, mixed $styleFirstRow = null)
4343
* @method Style\Numbering addNumberingStyle(string $styleName, mixed $styles)
4444
*/

src/PhpWord/Style.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Style
3939
* Add paragraph style
4040
*
4141
* @param string $styleName
42-
* @param array $styles
42+
* @param array|\PhpOffice\PhpWord\Style\AbstractStyle $styles
4343
* @return \PhpOffice\PhpWord\Style\Paragraph
4444
*/
4545
public static function addParagraphStyle($styleName, $styles)
@@ -51,8 +51,8 @@ public static function addParagraphStyle($styleName, $styles)
5151
* Add font style
5252
*
5353
* @param string $styleName
54-
* @param array $fontStyle
55-
* @param array $paragraphStyle
54+
* @param array|\PhpOffice\PhpWord\Style\AbstractStyle $fontStyle
55+
* @param array|\PhpOffice\PhpWord\Style\AbstractStyle $paragraphStyle
5656
* @return \PhpOffice\PhpWord\Style\Font
5757
*/
5858
public static function addFontStyle($styleName, $fontStyle, $paragraphStyle = null)
@@ -64,7 +64,7 @@ public static function addFontStyle($styleName, $fontStyle, $paragraphStyle = nu
6464
* Add link style
6565
*
6666
* @param string $styleName
67-
* @param array $styles
67+
* @param array|\PhpOffice\PhpWord\Style\AbstractStyle $styles
6868
* @return \PhpOffice\PhpWord\Style\Font
6969
*/
7070
public static function addLinkStyle($styleName, $styles)
@@ -76,7 +76,7 @@ public static function addLinkStyle($styleName, $styles)
7676
* Add numbering style
7777
*
7878
* @param string $styleName
79-
* @param array $styleValues
79+
* @param array|\PhpOffice\PhpWord\Style\AbstractStyle $styleValues
8080
* @return \PhpOffice\PhpWord\Style\Numbering
8181
* @since 0.10.0
8282
*/
@@ -88,14 +88,14 @@ public static function addNumberingStyle($styleName, $styleValues)
8888
/**
8989
* Add title style
9090
*
91-
* @param int $depth
92-
* @param array $fontStyle
93-
* @param array $paragraphStyle
91+
* @param int|null $depth Provide null to set title font
92+
* @param array|\PhpOffice\PhpWord\Style\AbstractStyle $fontStyle
93+
* @param array|\PhpOffice\PhpWord\Style\AbstractStyle $paragraphStyle
9494
* @return \PhpOffice\PhpWord\Style\Font
9595
*/
9696
public static function addTitleStyle($depth, $fontStyle, $paragraphStyle = null)
9797
{
98-
if ($depth == null) {
98+
if (empty($depth)) {
9999
$styleName = 'Title';
100100
} else {
101101
$styleName = "Heading_{$depth}";
@@ -141,7 +141,7 @@ public static function resetStyles()
141141
/**
142142
* Set default paragraph style
143143
*
144-
* @param array $styles Paragraph style definition
144+
* @param array|\PhpOffice\PhpWord\Style\AbstractStyle $styles Paragraph style definition
145145
* @return \PhpOffice\PhpWord\Style\Paragraph
146146
*/
147147
public static function setDefaultParagraphStyle($styles)

src/PhpWord/Style/Font.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ class Font extends AbstractStyle
264264
* Create new font style
265265
*
266266
* @param string $type Type of font
267-
* @param array $paragraph Paragraph styles definition
267+
* @param array|string|\PhpOffice\PhpWord\Style\AbstractStyle $paragraph Paragraph styles definition
268268
*/
269269
public function __construct($type = 'text', $paragraph = null)
270270
{

0 commit comments

Comments
 (0)