Skip to content

Commit 0e2f476

Browse files
committed
Docblock updates
1 parent 05a4b95 commit 0e2f476

29 files changed

+271
-31
lines changed

samples/Sample_Footer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
* Footer file
44
*/
55
// Do not show execution time for index
6-
if (!$isIndexFile) {
6+
if (!IS_INDEX) {
77
echo date('H:i:s'), " Done writing file(s)", EOL;
88
echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
99
}
1010
// Show message when executed with CLI, show links when using browsers
1111
if (CLI) {
1212
echo 'The results are stored in the "results" subdirectory.', EOL;
1313
} else {
14-
if (!$isIndexFile) {
14+
if (!IS_INDEX) {
1515
$types = array('docx', 'odt', 'rtf');
1616
echo '<p>&nbsp;</p>';
1717
echo '<p>Results: ';
1818
foreach ($types as $type) {
19-
$result = "results/{$sampleFile}.{$type}";
19+
$result = 'results/' . SCRIPT_FILENAME . '.' . $type;
2020
if (file_exists($result)) {
2121
echo "<a href='{$result}' class='btn btn-primary'>{$type}</a> ";
2222
}

samples/Sample_Header.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
error_reporting(E_ALL);
66
define('CLI', (PHP_SAPI == 'cli') ? true : false);
77
define('EOL', CLI ? PHP_EOL : '<br />');
8+
define('SCRIPT_FILENAME', basename($_SERVER['SCRIPT_FILENAME'], '.php'));
9+
define('IS_INDEX', SCRIPT_FILENAME == 'index');
810

911
require_once '../src/PhpWord/Autoloader.php';
1012
PhpOffice\PhpWord\Autoloader::register();
@@ -15,12 +17,10 @@
1517
}
1618

1719
// Set titles and names
18-
$sampleFile = basename($_SERVER['SCRIPT_FILENAME'], '.php');
19-
$isIndexFile = ($sampleFile == 'index');
20-
$pageHeading = str_replace('_', ' ', $sampleFile);
21-
$pageTitle = $isIndexFile ? 'Welcome to ' : "{$pageHeading} - ";
20+
$pageHeading = str_replace('_', ' ', SCRIPT_FILENAME);
21+
$pageTitle = IS_INDEX ? 'Welcome to ' : "{$pageHeading} - ";
2222
$pageTitle .= 'PHPWord';
23-
$pageHeading = $isIndexFile ? '' : "<h1>{$pageHeading}</h1>";
23+
$pageHeading = IS_INDEX ? '' : "<h1>{$pageHeading}</h1>";
2424
// Populate samples
2525
$files = '';
2626
if ($handle = opendir('.')) {

src/PhpWord/Section.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,9 @@ public function createFootnote($styleParagraph = null)
421421
*
422422
* @param string $name
423423
* @param string $text
424-
* @param mixed $style
425-
* @return PHPWord_Section_CheckBox
424+
* @param mixed $styleFont
425+
* @param mixed $styleParagraph
426+
* @return \PhpOffice\PhpWord\Section\CheckBox
426427
*/
427428
public function addCheckBox($name, $text, $styleFont = null, $styleParagraph = null)
428429
{

src/PhpWord/Section/CheckBox.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ public function getParagraphStyle()
129129
}
130130

131131
/**
132+
* Set name content
133+
*
132134
* @param string $name
133135
* @return $this
134136
*/
@@ -149,6 +151,8 @@ public function getName()
149151
}
150152

151153
/**
154+
* Set text content
155+
*
152156
* @param string $text
153157
* @return $this
154158
*/
@@ -159,7 +163,7 @@ public function setText($text)
159163
}
160164

161165
/**
162-
* Get Text content
166+
* Get text content
163167
*
164168
* @return string
165169
*/

src/PhpWord/Section/Table/Cell.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,9 @@ public function createTextRun($styleParagraph = null)
296296
*
297297
* @param string $name
298298
* @param string $text
299-
* @param mixed $style
300-
* @return PHPWord_Section_CheckBox
299+
* @param mixed $styleFont
300+
* @param mixed $styleParagraph
301+
* @return \PhpOffice\PhpWord\Section\CheckBox
301302
*/
302303
public function addCheckBox($name, $text, $styleFont = null, $styleParagraph = null)
303304
{

src/PhpWord/Writer/Word2007/Base.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,6 +1220,9 @@ protected function _writeFootnote(XMLWriter $xmlWriter, Footnote $footnote, $wit
12201220

12211221
/**
12221222
* Write CheckBox
1223+
*
1224+
* @param boolean $withoutP
1225+
* @param boolean $checkState
12231226
*/
12241227
protected function _writeCheckBox(XMLWriter $xmlWriter, CheckBox $checkbox, $withoutP = false, $checkState = false)
12251228
{

tests/PhpWord/Tests/Exceptions/ExceptionTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
class ExceptionTest extends \PHPUnit_Framework_TestCase
2121
{
2222
/**
23+
* Throw new exception
24+
*
2325
* @expectedException \PhpOffice\PhpWord\Exceptions\Exception
2426
* @covers \PhpOffice\PhpWord\Exceptions\Exception
2527
*/

tests/PhpWord/Tests/Exceptions/InvalidImageExceptionTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
class InvalidImageExceptionTest extends \PHPUnit_Framework_TestCase
2121
{
2222
/**
23+
* Throw new exception
24+
*
2325
* @expectedException \PhpOffice\PhpWord\Exceptions\InvalidImageException
2426
* @covers \PhpOffice\PhpWord\Exceptions\InvalidImageException
2527
*/

tests/PhpWord/Tests/Exceptions/InvalidStyleExceptionTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
class InvalidStyleExceptionTest extends \PHPUnit_Framework_TestCase
2121
{
2222
/**
23+
* Throw new exception
24+
*
2325
* @expectedException \PhpOffice\PhpWord\Exceptions\InvalidStyleException
2426
* @covers \PhpOffice\PhpWord\Exceptions\InvalidStyleException
2527
*/

tests/PhpWord/Tests/Exceptions/UnsupportedImageTypeExceptionTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
class UnsupportedImageTypeExceptionTest extends \PHPUnit_Framework_TestCase
2121
{
2222
/**
23+
* Throw new exception
24+
*
2325
* @expectedException \PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException
2426
* @covers \PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException
2527
*/

0 commit comments

Comments
 (0)