Skip to content

Commit 81182b7

Browse files
dantleechfabpot
authored andcommitted
Enforce sprintf for exceptions
1 parent 67687c8 commit 81182b7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Options.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public function get($option)
225225
$this->reading = true;
226226

227227
if (!array_key_exists($option, $this->options)) {
228-
throw new \OutOfBoundsException('The option "'.$option.'" does not exist.');
228+
throw new \OutOfBoundsException(sprintf('The option "%s" does not exist.', $option));
229229
}
230230

231231
if (isset($this->lazy[$option])) {
@@ -459,7 +459,7 @@ private function resolve($option)
459459
}
460460
}
461461

462-
throw new OptionDefinitionException('The options "'.implode('", "', $conflicts).'" have a cyclic dependency.');
462+
throw new OptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', implode('", "', $conflicts)));
463463
}
464464

465465
$this->lock[$option] = true;
@@ -497,7 +497,7 @@ private function normalize($option)
497497
}
498498
}
499499

500-
throw new OptionDefinitionException('The options "'.implode('", "', $conflicts).'" have a cyclic dependency.');
500+
throw new OptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', implode('", "', $conflicts)));
501501
}
502502

503503
/** @var \Closure $normalizer */

0 commit comments

Comments
 (0)