Skip to content

Commit

Permalink
phpmd fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
0b10011 committed Aug 28, 2019
1 parent 3ef1ef2 commit bf81af2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions phpmd.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
<rule ref="rulesets/design.xml/DepthOfInheritance" />
<rule ref="rulesets/design.xml/CouplingBetweenObjects">
<!-- AbstractContainer needs more coupling (default: 13) -->
<!-- Html needs 22 (default: 13) -->
<!-- Html needs 23 (default: 13) -->
<properties>
<property name="maximum" value="23" />
<property name="maximum" value="24" />
</properties>
</rule>
<rule ref="rulesets/design.xml/NumberOfChildren">
Expand Down
6 changes: 3 additions & 3 deletions src/PhpWord/Shared/Html.php
Original file line number Diff line number Diff line change
Expand Up @@ -956,17 +956,17 @@ protected static function mapBorderWidth(DOMNode $node, &$styles, string $cssSiz

protected static function expandBorderSides(DOMNode $node, string $valuesString)
{
$side_mapping = array(
$sideMapping = array(
'table' => array('top', 'end', 'bottom', 'start'),
'th' => array('top', 'end', 'bottom', 'start'),
'td' => array('top', 'end', 'bottom', 'start'),
'p' => array('top', 'right', 'bottom', 'left'),
);
if (!array_key_exists($node->nodeName, $side_mapping)) {
if (!array_key_exists($node->nodeName, $sideMapping)) {
trigger_error(sprintf('Node `%s` does not support borders', $node->nodeName), E_USER_WARNING);
}

$sides = $side_mapping[$node->nodeName];
$sides = $sideMapping[$node->nodeName];
$values = explode(' ', $valuesString);
if (count($values) > count($sides)) {
trigger_error(sprintf('Provided `%s` style `%s` had more than %d values', $node->nodeName, $valuesString, count($sides)), E_USER_WARNING);
Expand Down
4 changes: 2 additions & 2 deletions tests/PhpWord/Reader/Word2007/StyleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function testReadCellWidthBadType()
</w:tr>
</w:tbl>';

$phpWord = $this->getDocumentFromString(array('document' => $documentXml));
$this->getDocumentFromString(array('document' => $documentXml));
}

/**
Expand Down Expand Up @@ -297,7 +297,7 @@ public function testReadIndentBadType()
</w:tblPr>
</w:tbl>';

$phpWord = $this->getDocumentFromString(array('document' => $documentXml));
$this->getDocumentFromString(array('document' => $documentXml));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/PhpWord/Writer/Word2007/Style/CellTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function isSpecified(): bool
});
$row->addCell(null, $cellStyle);

$doc = TestHelperDOCX::getDocument($phpWord, 'Word2007');
TestHelperDOCX::getDocument($phpWord, 'Word2007');
}

public function testWidth()
Expand Down

0 comments on commit bf81af2

Please sign in to comment.