Skip to content

Commit b79a66b

Browse files
committed
1
2 parents 0779581 + 5e0fc7a commit b79a66b

File tree

107 files changed

+2451
-733
lines changed

Some content is hidden

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

107 files changed

+2451
-733
lines changed

Classes/PHPWord.php

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@
2626
*/
2727

2828
/** PHPWORD_BASE_PATH */
29+
// @codeCoverageIgnoreStart
2930
if (!defined('PHPWORD_BASE_PATH')) {
3031
define('PHPWORD_BASE_PATH', dirname(__FILE__) . '/');
3132
require PHPWORD_BASE_PATH . 'PHPWord/Autoloader.php';
3233
PHPWord_Autoloader::Register();
3334
}
34-
35+
// @codeCoverageIgnoreEnd
3536

3637
/**
3738
* PHPWord
@@ -155,7 +156,7 @@ public function setDefaultFontName($pValue)
155156
}
156157

157158
/**
158-
* Get default Font size
159+
* Get default Font size (in points)
159160
* @return string
160161
*/
161162
public function getDefaultFontSize()
@@ -164,15 +165,24 @@ public function getDefaultFontSize()
164165
}
165166

166167
/**
167-
* Set default Font size
168+
* Set default Font size (in points)
168169
* @param int $pValue
169170
*/
170171
public function setDefaultFontSize($pValue)
171172
{
172-
$pValue = $pValue * 2;
173173
$this->_defaultFontSize = $pValue;
174174
}
175175

176+
/**
177+
* Set default paragraph style definition to styles.xml
178+
*
179+
* @param array $styles Paragraph style definition
180+
*/
181+
public function setDefaultParagraphStyle($styles)
182+
{
183+
PHPWord_Style::setDefaultParagraphStyle($styles);
184+
}
185+
176186
/**
177187
* Adds a paragraph style definition to styles.xml
178188
*
@@ -217,16 +227,6 @@ public function addTitleStyle($titleCount, $styleFont, $styleParagraph = null)
217227
PHPWord_Style::addTitleStyle($titleCount, $styleFont, $styleParagraph);
218228
}
219229

220-
/**
221-
* Set default paragraph style definition to styles.xml
222-
*
223-
* @param array $styles Paragraph style definition
224-
*/
225-
public function setDefaultParagraphStyle($styles)
226-
{
227-
PHPWord_Style::setDefaultParagraphStyle($styles);
228-
}
229-
230230
/**
231231
* Adds a hyperlink style to styles.xml
232232
*
@@ -247,15 +247,6 @@ public function getSections()
247247
return $this->_sectionCollection;
248248
}
249249

250-
/**
251-
* Get section count
252-
* @return int
253-
*/
254-
private function _countSections()
255-
{
256-
return count($this->_sectionCollection);
257-
}
258-
259250
/**
260251
* Load a Template File
261252
*
@@ -268,7 +259,18 @@ public function loadTemplate($strFilename)
268259
$template = new PHPWord_Template($strFilename);
269260
return $template;
270261
} else {
271-
trigger_error('Template file ' . $strFilename . ' not found.', E_USER_ERROR);
262+
throw new PHPWord_Exception(
263+
"Template file {$strFilename} not found."
264+
);
272265
}
273266
}
274-
}
267+
268+
/**
269+
* Get section count
270+
* @return int
271+
*/
272+
private function _countSections()
273+
{
274+
return count($this->_sectionCollection);
275+
}
276+
}

Classes/PHPWord/Autoloader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,4 @@ public static function autoload($class)
8282
}
8383
}
8484
}
85-
}
85+
}

0 commit comments

Comments
 (0)