Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ before_script:
- composer self-update
- travis_wait composer install --prefer-source
## PHPDocumentor
- mkdir -p build/docs
##- mkdir -p build/docs
- mkdir -p build/coverage

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

after_success:
## Coveralls
Expand Down
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,13 @@
},
"require-dev": {
"phpunit/phpunit": "^4.8.36 || ^5.0",
"phpdocumentor/phpdocumentor":"2.*",
"squizlabs/php_codesniffer": "^2.7",
"friendsofphp/php-cs-fixer": "^2.0",
"squizlabs/php_codesniffer": "^2.9",
"friendsofphp/php-cs-fixer": "^2.2",
"phpmd/phpmd": "2.*",
"phploc/phploc": "2.* || 3.* || 4.*",
"dompdf/dompdf":"0.8.*",
"tecnickcom/tcpdf": "6.*",
"mpdf/mpdf": "5.* || 6.* || 7.*",
"mpdf/mpdf": "5.7.4 || 6.* || 7.*",
"php-coveralls/php-coveralls": "1.1.0 || ^2.0"
},
"suggest": {
Expand Down
2 changes: 1 addition & 1 deletion src/PhpWord/Element/AbstractElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public function getParent()
*
* @param \PhpOffice\PhpWord\Element\AbstractElement $container
*/
public function setParentContainer(AbstractElement $container)
public function setParentContainer(self $container)
{
$this->parentContainer = substr(get_class($container), strrpos(get_class($container), '\\') + 1);
$this->parent = $container;
Expand Down
4 changes: 2 additions & 2 deletions src/PhpWord/PhpWord.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
* @method int addChart(Element\Chart $chart)
* @method int addComment(Element\Comment $comment)
*
* @method Style\Paragraph addParagraphStyle(string $styleName, array $styles)
* @method Style\Paragraph addParagraphStyle(string $styleName, mixed $styles)
* @method Style\Font addFontStyle(string $styleName, mixed $fontStyle, mixed $paragraphStyle = null)
* @method Style\Font addLinkStyle(string $styleName, mixed $styles)
* @method Style\Font addTitleStyle(int $depth, mixed $fontStyle, mixed $paragraphStyle = null)
* @method Style\Font addTitleStyle(mixed $depth, mixed $fontStyle, mixed $paragraphStyle = null)
* @method Style\Table addTableStyle(string $styleName, mixed $styleTable, mixed $styleFirstRow = null)
* @method Style\Numbering addNumberingStyle(string $styleName, mixed $styles)
*/
Expand Down
20 changes: 10 additions & 10 deletions src/PhpWord/Style.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Style
* Add paragraph style
*
* @param string $styleName
* @param array $styles
* @param array|\PhpOffice\PhpWord\Style\AbstractStyle $styles
* @return \PhpOffice\PhpWord\Style\Paragraph
*/
public static function addParagraphStyle($styleName, $styles)
Expand All @@ -51,8 +51,8 @@ public static function addParagraphStyle($styleName, $styles)
* Add font style
*
* @param string $styleName
* @param array $fontStyle
* @param array $paragraphStyle
* @param array|\PhpOffice\PhpWord\Style\AbstractStyle $fontStyle
* @param array|\PhpOffice\PhpWord\Style\AbstractStyle $paragraphStyle
* @return \PhpOffice\PhpWord\Style\Font
*/
public static function addFontStyle($styleName, $fontStyle, $paragraphStyle = null)
Expand All @@ -64,7 +64,7 @@ public static function addFontStyle($styleName, $fontStyle, $paragraphStyle = nu
* Add link style
*
* @param string $styleName
* @param array $styles
* @param array|\PhpOffice\PhpWord\Style\AbstractStyle $styles
* @return \PhpOffice\PhpWord\Style\Font
*/
public static function addLinkStyle($styleName, $styles)
Expand All @@ -76,7 +76,7 @@ public static function addLinkStyle($styleName, $styles)
* Add numbering style
*
* @param string $styleName
* @param array $styleValues
* @param array|\PhpOffice\PhpWord\Style\AbstractStyle $styleValues
* @return \PhpOffice\PhpWord\Style\Numbering
* @since 0.10.0
*/
Expand All @@ -88,14 +88,14 @@ public static function addNumberingStyle($styleName, $styleValues)
/**
* Add title style
*
* @param int $depth
* @param array $fontStyle
* @param array $paragraphStyle
* @param int|null $depth Provide null to set title font
* @param array|\PhpOffice\PhpWord\Style\AbstractStyle $fontStyle
* @param array|\PhpOffice\PhpWord\Style\AbstractStyle $paragraphStyle
* @return \PhpOffice\PhpWord\Style\Font
*/
public static function addTitleStyle($depth, $fontStyle, $paragraphStyle = null)
{
if ($depth == null) {
if (empty($depth)) {
$styleName = 'Title';
} else {
$styleName = "Heading_{$depth}";
Expand Down Expand Up @@ -141,7 +141,7 @@ public static function resetStyles()
/**
* Set default paragraph style
*
* @param array $styles Paragraph style definition
* @param array|\PhpOffice\PhpWord\Style\AbstractStyle $styles Paragraph style definition
* @return \PhpOffice\PhpWord\Style\Paragraph
*/
public static function setDefaultParagraphStyle($styles)
Expand Down
2 changes: 1 addition & 1 deletion src/PhpWord/Style/Font.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ class Font extends AbstractStyle
* Create new font style
*
* @param string $type Type of font
* @param array $paragraph Paragraph styles definition
* @param array|string|\PhpOffice\PhpWord\Style\AbstractStyle $paragraph Paragraph styles definition
*/
public function __construct($type = 'text', $paragraph = null)
{
Expand Down