Skip to content

Commit 9e4c470

Browse files
committed
Address scrutinizer issue
1 parent 7272d3a commit 9e4c470

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/PHPEncoder.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@ public function addEncoder(Encoder\Encoder $encoder, $prepend = false)
9494
public function setOption($option, $value)
9595
{
9696
if (!$this->isValidOption($option)) {
97-
throw new InvalidOptionException("Invalid encoder option '$option'");
97+
throw new InvalidOptionException(sprintf(
98+
"Invalid encoder option '%s'",
99+
$option
100+
));
98101
}
99102

100103
$this->options[$option] = $value;
@@ -150,7 +153,10 @@ public function getAllOptions(array $overrides = [])
150153

151154
foreach ($overrides as $name => $value) {
152155
if (!array_key_exists($name, $options)) {
153-
throw new InvalidOptionException("Invalid encoder option '$name'");
156+
throw new InvalidOptionException(sprintf(
157+
"Invalid encoder option '%s'",
158+
$name
159+
));
154160
}
155161

156162
$options[$name] = $value;

0 commit comments

Comments
 (0)