Skip to content

Commit bf81af2

Browse files
committed
phpmd fixes
1 parent 3ef1ef2 commit bf81af2

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

phpmd.xml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
<rule ref="rulesets/design.xml/DepthOfInheritance" />
1919
<rule ref="rulesets/design.xml/CouplingBetweenObjects">
2020
<!-- AbstractContainer needs more coupling (default: 13) -->
21-
<!-- Html needs 22 (default: 13) -->
21+
<!-- Html needs 23 (default: 13) -->
2222
<properties>
23-
<property name="maximum" value="23" />
23+
<property name="maximum" value="24" />
2424
</properties>
2525
</rule>
2626
<rule ref="rulesets/design.xml/NumberOfChildren">

src/PhpWord/Shared/Html.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -956,17 +956,17 @@ protected static function mapBorderWidth(DOMNode $node, &$styles, string $cssSiz
956956

957957
protected static function expandBorderSides(DOMNode $node, string $valuesString)
958958
{
959-
$side_mapping = array(
959+
$sideMapping = array(
960960
'table' => array('top', 'end', 'bottom', 'start'),
961961
'th' => array('top', 'end', 'bottom', 'start'),
962962
'td' => array('top', 'end', 'bottom', 'start'),
963963
'p' => array('top', 'right', 'bottom', 'left'),
964964
);
965-
if (!array_key_exists($node->nodeName, $side_mapping)) {
965+
if (!array_key_exists($node->nodeName, $sideMapping)) {
966966
trigger_error(sprintf('Node `%s` does not support borders', $node->nodeName), E_USER_WARNING);
967967
}
968968

969-
$sides = $side_mapping[$node->nodeName];
969+
$sides = $sideMapping[$node->nodeName];
970970
$values = explode(' ', $valuesString);
971971
if (count($values) > count($sides)) {
972972
trigger_error(sprintf('Provided `%s` style `%s` had more than %d values', $node->nodeName, $valuesString, count($sides)), E_USER_WARNING);

tests/PhpWord/Reader/Word2007/StyleTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public function testReadCellWidthBadType()
162162
</w:tr>
163163
</w:tbl>';
164164

165-
$phpWord = $this->getDocumentFromString(array('document' => $documentXml));
165+
$this->getDocumentFromString(array('document' => $documentXml));
166166
}
167167

168168
/**
@@ -297,7 +297,7 @@ public function testReadIndentBadType()
297297
</w:tblPr>
298298
</w:tbl>';
299299

300-
$phpWord = $this->getDocumentFromString(array('document' => $documentXml));
300+
$this->getDocumentFromString(array('document' => $documentXml));
301301
}
302302

303303
/**

tests/PhpWord/Writer/Word2007/Style/CellTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function isSpecified(): bool
8888
});
8989
$row->addCell(null, $cellStyle);
9090

91-
$doc = TestHelperDOCX::getDocument($phpWord, 'Word2007');
91+
TestHelperDOCX::getDocument($phpWord, 'Word2007');
9292
}
9393

9494
public function testWidth()

0 commit comments

Comments
 (0)