Skip to content

Commit

Permalink
compatibility with phpmd 2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
liborm85 committed Oct 17, 2020
1 parent adb9172 commit e334ecf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 2 additions & 0 deletions phpmd.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<rule ref="rulesets/naming.xml">
<exclude name="ShortVariable" />
<exclude name="ShortClassName" />
<exclude name="LongVariable" />
</rule>
<rule ref="rulesets/naming.xml/LongVariable">
Expand Down
16 changes: 8 additions & 8 deletions src/PhpWord/Reader/MsDoc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1581,7 +1581,7 @@ private function readPrl($data, $pos, $cbNum)
// Variables
$sprmCPicLocation = null;
$sprmCFData = null;
$sprmCFSpec = null;
//$sprmCFSpec = null;

do {
// Variables
Expand Down Expand Up @@ -1830,7 +1830,7 @@ private function readPrl($data, $pos, $cbNum)
break;
// sprmCFSpec
case 0x55:
$sprmCFSpec = $operand;
//$sprmCFSpec = $operand;
break;
// sprmCFtcBi
case 0x5E:
Expand Down Expand Up @@ -2094,11 +2094,11 @@ private function readPrl($data, $pos, $cbNum)
$sprmCPicLocation += 1;

// stPicName
$stPicName = '';
//$stPicName = '';
for ($inc = 0; $inc <= $cchPicName; $inc++) {
$chr = self::getInt1d($this->dataData, $sprmCPicLocation);
//$chr = self::getInt1d($this->dataData, $sprmCPicLocation);
$sprmCPicLocation += 1;
$stPicName .= chr($chr);
//$stPicName .= chr($chr);
}
}

Expand Down Expand Up @@ -2143,11 +2143,11 @@ private function readPrl($data, $pos, $cbNum)
$sprmCPicLocation += 1;
// nameData
if ($cbName > 0) {
$nameData = '';
//$nameData = '';
for ($inc = 0; $inc <= ($cbName / 2); $inc++) {
$chr = self::getInt2d($this->dataData, $sprmCPicLocation);
//$chr = self::getInt2d($this->dataData, $sprmCPicLocation);
$sprmCPicLocation += 2;
$nameData .= chr($chr);
//$nameData .= chr($chr);
}
}
// embeddedBlip
Expand Down
6 changes: 3 additions & 3 deletions tests/PhpWord/Element/TableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ public function testCountColumns()
{
$oTable = new Table();
$oTable->addRow();
$element = $oTable->addCell();
$oTable->addCell();
$this->assertEquals($oTable->countColumns(), 1);
$element = $oTable->addCell();
$element = $oTable->addCell();
$oTable->addCell();
$oTable->addCell();
$this->assertEquals($oTable->countColumns(), 3);
}
}

0 comments on commit e334ecf

Please sign in to comment.