Skip to content

Commit 4f93998

Browse files
committed
QA: Docblock improvements and -q parameter for phpdoc
1 parent 900a96a commit 4f93998

File tree

7 files changed

+16
-6
lines changed

7 files changed

+16
-6
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ script:
5050
## PHPUnit
5151
- phpunit -c ./ --coverage-text --coverage-html ./build/coverage
5252
## PHPDocumentor
53-
- vendor/bin/phpdoc.php -d ./src -t ./build/docs --ignore "*/src/PhpWord/Shared/*/*" --template="responsive-twig"
53+
- vendor/bin/phpdoc.php -q -d ./src -t ./build/docs --ignore "*/src/PhpWord/Shared/*/*" --template="responsive-twig"
5454

5555
after_script:
5656
## PHPDocumentor

src/PhpWord/Reader/Word2007/AbstractPart.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ private function readCellStyle(XMLReader $xmlReader, \DOMElement $domNode)
437437
* @param \PhpOffice\PhpWord\Shared\XMLReader $xmlReader
438438
* @param \DOMElement $parentNode
439439
* @param array $styleDefs
440+
* @ignoreScrutinizerPatch
440441
* @return array
441442
*/
442443
protected function readStyleDefs(XMLReader $xmlReader, \DOMElement $parentNode = null, $styleDefs = array())
@@ -467,6 +468,7 @@ protected function readStyleDefs(XMLReader $xmlReader, \DOMElement $parentNode =
467468
* Return style definition based on conversion method
468469
*
469470
* @param string $method
471+
* @ignoreScrutinizerPatch
470472
* @param mixed $attributeValue
471473
* @param mixed $expected
472474
* @return mixed

src/PhpWord/Reader/Word2007/Document.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ private function readHeaderFooter($settings, Section &$section)
9999
*
100100
* @param \PhpOffice\PhpWord\Shared\XMLReader $xmlReader
101101
* @param \DOMElement $domNode
102+
* @ignoreScrutinizerPatch
102103
* @return array
103104
*/
104105
private function readSectionStyle(XMLReader $xmlReader, \DOMElement $domNode)

src/PhpWord/Shared/Html.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,9 @@ protected static function parseNode(
242242
$cNodes = $node->childNodes;
243243
if (count($cNodes) > 0) {
244244
foreach ($cNodes as $cNode) {
245-
self::parseNode($cNode, $newobject, $styles, $data);
245+
if ($newobject instanceof \PhpOffice\PhpWord\Element\AbstractContainer) {
246+
self::parseNode($cNode, $newobject, $styles, $data);
247+
}
246248
}
247249
}
248250
}

src/PhpWord/Style/Image.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ public function getMarginTop()
245245
/**
246246
* Set margin top
247247
*
248+
* @ignoreScrutinizerPatch
248249
* @param int|float $value
249250
* @return self
250251
*/
@@ -268,6 +269,7 @@ public function getMarginLeft()
268269
/**
269270
* Set margin left
270271
*
272+
* @ignoreScrutinizerPatch
271273
* @param int|float $value
272274
* @return self
273275
*/

src/PhpWord/Style/Paragraph.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public function setStyleValue($key, $value)
190190
*/
191191
public function getStyleValues()
192192
{
193-
return array(
193+
$styles = array(
194194
'name' => $this->getStyleName(),
195195
'basedOn' => $this->getBasedOn(),
196196
'next' => $this->getNext(),
@@ -209,6 +209,8 @@ public function getStyleValues()
209209
),
210210
'tabs' => $this->getTabs(),
211211
);
212+
213+
return $styles;
212214
}
213215

214216
/**

src/PhpWord/Writer/Word2007/Style/Paragraph.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use PhpOffice\PhpWord\Shared\XMLWriter;
2121
use PhpOffice\PhpWord\Style;
2222
use PhpOffice\PhpWord\Style\Alignment as AlignmentStyle;
23+
use PhpOffice\PhpWord\Style\Paragraph as ParagraphStyle;
2324

2425
/**
2526
* Paragraph style writer
@@ -71,7 +72,7 @@ public function write()
7172
private function writeStyle()
7273
{
7374
$style = $this->getStyle();
74-
if (!$style instanceof \PhpOffice\PhpWord\Style\Paragraph) {
75+
if (!$style instanceof ParagraphStyle) {
7576
return;
7677
}
7778
$xmlWriter = $this->getXmlWriter();
@@ -114,7 +115,7 @@ private function writeStyle()
114115
*
115116
* @param \PhpOffice\PhpWord\Shared\XMLWriter $xmlWriter
116117
* @param string $name
117-
* @param string $value
118+
* @param mixed $value
118119
*/
119120
private function writeChildStyle(XMLWriter $xmlWriter, $name, $value)
120121
{
@@ -131,7 +132,7 @@ private function writeChildStyle(XMLWriter $xmlWriter, $name, $value)
131132
* Write tabs
132133
*
133134
* @param \PhpOffice\PhpWord\Shared\XMLWriter $xmlWriter
134-
* @param array $tabs
135+
* @param \PhpOffice\PhpWord\Style\Tab[] $tabs
135136
*/
136137
private function writeTabs(XMLWriter $xmlWriter, $tabs)
137138
{

0 commit comments

Comments
 (0)