From 671b683acc500195bce0d6fc26f77664a65c30c9 Mon Sep 17 00:00:00 2001 From: h6w Date: Wed, 19 Nov 2014 12:58:16 +1100 Subject: [PATCH 1/2] Update AbstractStyle.php Provide more information when style import fails. --- src/PhpWord/Style/AbstractStyle.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpWord/Style/AbstractStyle.php b/src/PhpWord/Style/AbstractStyle.php index 13ef8f9b26..fc7c05e9c5 100644 --- a/src/PhpWord/Style/AbstractStyle.php +++ b/src/PhpWord/Style/AbstractStyle.php @@ -264,7 +264,7 @@ protected function setFloatVal($value, $default = null) protected function setEnumVal($value = null, $enum = array(), $default = null) { if ($value != null && trim($value) != '' && !empty($enum) && !in_array($value, $enum)) { - throw new \InvalidArgumentException('Invalid style value.'); + throw new \InvalidArgumentException('Invalid style value:'.$value.' Options:'.join(',',$enum)); } elseif ($value === null || trim($value) == '') { $value = $default; } From 94239c08ffeff75a3ed8e29712749b933a609227 Mon Sep 17 00:00:00 2001 From: h6w Date: Wed, 19 Nov 2014 13:28:53 +1100 Subject: [PATCH 2/2] Update AbstractStyle.php Stylistic code fix for scrutinizer. --- src/PhpWord/Style/AbstractStyle.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpWord/Style/AbstractStyle.php b/src/PhpWord/Style/AbstractStyle.php index fc7c05e9c5..33d0070e16 100644 --- a/src/PhpWord/Style/AbstractStyle.php +++ b/src/PhpWord/Style/AbstractStyle.php @@ -264,7 +264,7 @@ protected function setFloatVal($value, $default = null) protected function setEnumVal($value = null, $enum = array(), $default = null) { if ($value != null && trim($value) != '' && !empty($enum) && !in_array($value, $enum)) { - throw new \InvalidArgumentException('Invalid style value:'.$value.' Options:'.join(',',$enum)); + throw new \InvalidArgumentException('Invalid style value:'.$value.' Options:'.join(',', $enum)); } elseif ($value === null || trim($value) == '') { $value = $default; }