Skip to content

Commit d4d498d

Browse files
committed
Merge pull request PHPOffice#458 from h6w/develop
Report enumerated style options available when style unknown.
2 parents c44bd37 + 7d2c0a6 commit d4d498d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ This release added form fields (textinput, checkbox, and dropdown), drawing shap
2626
- MsDOC Reader: Basic MsDOC Reader - @Progi1984 GH-23 GH-287
2727
- "absolute" horizontal and vertical positioning of Frame - @basjan GH-302
2828
- Add new-page function for PDF generation. For multiple PDF-backends - @chc88 GH-426
29+
- Report style options enumerated when style unknown - @h6w
2930

3031
### Bugfixes
3132

src/PhpWord/Style/AbstractStyle.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ protected function setFloatVal($value, $default = null)
284284
protected function setEnumVal($value = null, $enum = array(), $default = null)
285285
{
286286
if ($value != null && trim($value) != '' && !empty($enum) && !in_array($value, $enum)) {
287-
throw new \InvalidArgumentException("Invalid style value: {$value}");
287+
throw new \InvalidArgumentException("Invalid style value: {$value} Options:".join(',', $enum));
288288
} elseif ($value === null || trim($value) == '') {
289289
$value = $default;
290290
}

0 commit comments

Comments
 (0)