Skip to content

Commit b11e612

Browse files
committed
Fix typographical error in exception message in InputBag class
1 parent 25ae878 commit b11e612

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

InputBag.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class InputBag extends ParameterBag
2828
public function get(string $key, mixed $default = null): string|int|float|bool|null
2929
{
3030
if (null !== $default && !\is_scalar($default) && !$default instanceof \Stringable) {
31-
throw new \InvalidArgumentException(sprintf('Excepted a scalar value as a 2nd argument to "%s()", "%s" given.', __METHOD__, get_debug_type($default)));
31+
throw new \InvalidArgumentException(sprintf('Expected a scalar value as a 2nd argument to "%s()", "%s" given.', __METHOD__, get_debug_type($default)));
3232
}
3333

3434
$value = parent::get($key, $this);
@@ -67,7 +67,7 @@ public function add(array $inputs = [])
6767
public function set(string $key, mixed $value)
6868
{
6969
if (null !== $value && !\is_scalar($value) && !\is_array($value) && !$value instanceof \Stringable) {
70-
throw new \InvalidArgumentException(sprintf('Excepted a scalar, or an array as a 2nd argument to "%s()", "%s" given.', __METHOD__, get_debug_type($value)));
70+
throw new \InvalidArgumentException(sprintf('Expected a scalar, or an array as a 2nd argument to "%s()", "%s" given.', __METHOD__, get_debug_type($value)));
7171
}
7272

7373
$this->parameters[$key] = $value;

Tests/InputBagTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function testFilterClosure()
6868
public function testSetWithNonScalarOrArray()
6969
{
7070
$this->expectException(\InvalidArgumentException::class);
71-
$this->expectExceptionMessage('Excepted a scalar, or an array as a 2nd argument to "Symfony\Component\HttpFoundation\InputBag::set()", "Symfony\Component\HttpFoundation\InputBag" given.');
71+
$this->expectExceptionMessage('Expected a scalar, or an array as a 2nd argument to "Symfony\Component\HttpFoundation\InputBag::set()", "Symfony\Component\HttpFoundation\InputBag" given.');
7272

7373
$bag = new InputBag();
7474
$bag->set('foo', new InputBag());
@@ -86,7 +86,7 @@ public function testGettingANonStringValue()
8686
public function testGetWithNonStringDefaultValue()
8787
{
8888
$this->expectException(\InvalidArgumentException::class);
89-
$this->expectExceptionMessage('Excepted a scalar value as a 2nd argument to "Symfony\Component\HttpFoundation\InputBag::get()", "array" given.');
89+
$this->expectExceptionMessage('Expected a scalar value as a 2nd argument to "Symfony\Component\HttpFoundation\InputBag::get()", "array" given.');
9090

9191
$bag = new InputBag(['foo' => 'bar']);
9292
$bag->get('foo', ['a', 'b']);

0 commit comments

Comments
 (0)