Skip to content

Commit abbf60a

Browse files
committed
Increase minimum mass for php_sim and some test fixes
1 parent 27fa3ba commit abbf60a

File tree

4 files changed

+18
-36
lines changed

4 files changed

+18
-36
lines changed

.scrutinizer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ tools:
1818
timeout: 900
1919
php_sim:
2020
enabled: true
21-
min_mass: 30
21+
min_mass: 40
2222
php_pdepend: true
2323
php_analyzer: true
2424
sensiolabs_security_checker: true

src/PhpWord/Style/Table.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,23 +123,24 @@ class Table extends Border
123123
public function __construct($tableStyle = null, $firstRowStyle = null)
124124
{
125125
$this->alignment = new Alignment();
126-
if ($tableStyle !== null && is_array($tableStyle)) {
127-
$this->setStyleByArray($tableStyle);
128-
}
129126

130127
if ($firstRowStyle !== null && is_array($firstRowStyle)) {
131128
$this->firstRow = clone $this;
132129
unset($this->firstRow->firstRow);
133-
unset($this->firstRow->cellMarginBottom);
130+
unset($this->firstRow->borderInsideHSize);
131+
unset($this->firstRow->borderInsideHColor);
132+
unset($this->firstRow->borderInsideVSize);
133+
unset($this->firstRow->borderInsideVColor);
134134
unset($this->firstRow->cellMarginTop);
135135
unset($this->firstRow->cellMarginLeft);
136136
unset($this->firstRow->cellMarginRight);
137-
unset($this->firstRow->borderInsideVColor);
138-
unset($this->firstRow->borderInsideVSize);
139-
unset($this->firstRow->borderInsideHColor);
140-
unset($this->firstRow->borderInsideHSize);
137+
unset($this->firstRow->cellMarginBottom);
141138
$this->firstRow->setStyleByArray($firstRowStyle);
142139
}
140+
141+
if ($tableStyle !== null && is_array($tableStyle)) {
142+
$this->setStyleByArray($tableStyle);
143+
}
143144
}
144145

145146
/**

tests/PhpWord/Tests/Element/ListItemRunTest.php

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function testConstructNull()
4444
*/
4545
public function testConstructString()
4646
{
47-
$oListItemRun = new ListItemRun(0, null, null, 'pStyle');
47+
$oListItemRun = new ListItemRun(0, null, 'pStyle');
4848

4949
$this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\ListItemRun', $oListItemRun);
5050
$this->assertCount(0, $oListItemRun->getElements());
@@ -56,29 +56,22 @@ public function testConstructString()
5656
*/
5757
public function testConstructArray()
5858
{
59-
$oListItemRun = new ListItemRun(0, null, null, array('spacing' => 100));
59+
$oListItemRun = new ListItemRun(0, null, array('spacing' => 100));
6060

6161
$this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\ListItemRun', $oListItemRun);
6262
$this->assertCount(0, $oListItemRun->getElements());
6363
$this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\Paragraph', $oListItemRun->getParagraphStyle());
6464
}
65-
65+
6666
/**
6767
* Get style
6868
*/
6969
public function testStyle()
7070
{
71-
$oListItemRun = new ListItemRun(
72-
1,
73-
null,
74-
array('listType' => \PhpOffice\PhpWord\Style\ListItem::TYPE_NUMBER)
75-
);
76-
71+
$oListItemRun = new ListItemRun(1, array('listType' => \PhpOffice\PhpWord\Style\ListItem::TYPE_NUMBER));
72+
7773
$this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\ListItem', $oListItemRun->getStyle());
78-
$this->assertEquals(
79-
$oListItemRun->getStyle()->getListType(),
80-
\PhpOffice\PhpWord\Style\ListItem::TYPE_NUMBER
81-
);
74+
$this->assertEquals($oListItemRun->getStyle()->getListType(), \PhpOffice\PhpWord\Style\ListItem::TYPE_NUMBER);
8275
}
8376
/**
8477
* getDepth
@@ -87,10 +80,10 @@ public function testDepth()
8780
{
8881
$iVal = rand(1, 1000);
8982
$oListItemRun = new ListItemRun($iVal);
90-
83+
9184
$this->assertEquals($oListItemRun->getDepth(), $iVal);
9285
}
93-
86+
9487
/**
9588
* Add text
9689
*/

tests/PhpWord/Tests/Element/TitleTest.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,4 @@ public function testStyleNull()
4747

4848
$this->assertEquals($oTitle->getStyle(), null);
4949
}
50-
51-
/**
52-
* Get bookmark Id
53-
*/
54-
public function testBookmarkID()
55-
{
56-
$oTitle = new Title('text');
57-
58-
$iVal = rand(1, 1000);
59-
$oTitle->setBookmarkId($iVal);
60-
$this->assertEquals($oTitle->getRelationId(), $iVal);
61-
}
6250
}

0 commit comments

Comments
 (0)