Skip to content

Commit d2a2317

Browse files
committed
Code formatting for PSR1 & PSR2 - Part 2
1 parent 4e3450e commit d2a2317

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+81
-99
lines changed

Classes/PHPWord/HashTable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function addFromSource($pSource = null)
6969
// Check if an array was passed
7070
if ($pSource == null) {
7171
return;
72-
} else if (!is_array($pSource)) {
72+
} elseif (!is_array($pSource)) {
7373
throw new Exception('Invalid array parameter passed.');
7474
}
7575

@@ -91,7 +91,7 @@ public function add(PHPWord_IComparable $pSource = null)
9191
$hashIndex = $pSource->getHashIndex();
9292
if (is_null($hashIndex)) {
9393
$hashCode = $pSource->getHashCode();
94-
} else if (isset ($this->_keyMap[$hashIndex])) {
94+
} elseif (isset ($this->_keyMap[$hashIndex])) {
9595
$hashCode = $this->_keyMap[$hashIndex];
9696
} else {
9797
$hashCode = $pSource->getHashCode();

Classes/PHPWord/Writer/ODText.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function save($pFilename = null)
161161
}
162162

163163
$objZip->addFromString('Pictures/' . str_replace(' ', '_', $this->getDrawingHashTable()->getByIndex($i)->getIndexedFilename()), $imageContents);
164-
} else if ($this->getDrawingHashTable()->getByIndex($i) instanceof PHPWord_Shape_MemoryDrawing) {
164+
} elseif ($this->getDrawingHashTable()->getByIndex($i) instanceof PHPWord_Shape_MemoryDrawing) {
165165
ob_start();
166166
call_user_func(
167167
$this->getDrawingHashTable()->getByIndex($i)->getRenderingFunction(),

Classes/PHPWord/Writer/ODText/Manifest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function writeManifest(PHPWord $pPHPWord = null)
8686
$objWriter->writeAttribute('manifest:media-type', $mimeType);
8787
$objWriter->writeAttribute('manifest:full-path', 'Pictures/' . str_replace(' ', '_', $this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getIndexedFilename()));
8888
$objWriter->endElement();
89-
} else if ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof PHPWord_Shape_MemoryDrawing) {
89+
} elseif ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof PHPWord_Shape_MemoryDrawing) {
9090
$extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getMimeType());
9191
$extension = explode('/', $extension);
9292
$extension = $extension[1];

Tests/PHPWord/AutoloaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ public function testAutoload()
2929
Autoloader::autoload('PhpOffice\\PhpWord\\Exceptions\\InvalidStyleException'); // TODO change this class to the main PHPWord class when it is namespaced
3030
$this->assertTrue(in_array('PhpOffice\\PhpWord\\Exceptions\\InvalidStyleException', get_declared_classes()), 'PhpOffice\\PhpWord\\Autoloader::autoload() failed to autoload the PhpOffice\\PhpWord\\Exceptions\\InvalidStyleException class');
3131
}
32-
}
32+
}

Tests/PHPWord/IOFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ public function testCreateWriter()
5959

6060
$this->assertEquals(PHPWord_IOFactory::createWriter($oPHPWord, 'Word2007'), new PHPWord_Writer_Word2007($oPHPWord));
6161
}
62-
}
62+
}

Tests/PHPWord/MediaTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ public function testGetFooterMediaElements()
2525
{
2626
$this->assertAttributeEquals(PHPWord_Media::getFooterMediaElements(), '_footerMedia', 'PHPWord_Media');
2727
}
28-
}
28+
}

Tests/PHPWord/Section/Footer/PreserveTextTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ public function testConstructWithArray()
3030
$this->assertInstanceOf('PHPWord_Style_Font', $oPreserveText->getFontStyle());
3131
$this->assertInstanceOf('PHPWord_Style_Paragraph', $oPreserveText->getParagraphStyle());
3232
}
33-
}
33+
}

Tests/PHPWord/Section/FooterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,4 @@ public function testGetElements()
118118

119119
$this->assertInternalType('array', $oFooter->getElements());
120120
}
121-
}
121+
}

Tests/PHPWord/Section/FootnoteTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ public function testGetElements()
6161
$oFootnote = new PHPWord_Section_Footnote();
6262
$this->assertInternalType('array', $oFootnote->getElements());
6363
}
64-
}
64+
}

Tests/PHPWord/Section/HeaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,4 @@ public function testEvenPage()
161161

162162
$this->assertEquals($oHeader->getType(), PHPWord_Section_Header::EVEN);
163163
}
164-
}
164+
}

0 commit comments

Comments
 (0)