Skip to content

Commit aa1647f

Browse files
committed
updated based on review
Signed-off-by: bidi <bidi@apidemia.com>
1 parent bd126f6 commit aa1647f

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

‎.laminas-ci.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"ignore_php_platform_requirements": {
33
"8.6": true
44
},
5-
"backwardCompatibilityCheck": false
5+
"backwardCompatibilityCheck": true
66
}

‎src/Exception/InvalidConfigException.php‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,19 @@
66

77
use InvalidArgumentException;
88
use Psr\Container\ContainerExceptionInterface;
9+
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
10+
11+
use function sprintf;
912

1013
class InvalidConfigException extends InvalidArgumentException implements
1114
ContainerExceptionInterface,
1215
ExceptionInterface
1316
{
1417
public const string MESSAGE_INVALID_EVENT_DISPATCHER
15-
= 'The event dispatcher service must implement Symfony\Component\EventDispatcher\EventDispatcherInterface.';
18+
= 'The event dispatcher service must implement "%s".';
1619

1720
public static function invalidEventDispatcher(): self
1821
{
19-
return new self(self::MESSAGE_INVALID_EVENT_DISPATCHER);
22+
return new self(sprintf(self::MESSAGE_INVALID_EVENT_DISPATCHER, EventDispatcherInterface::class));
2023
}
2124
}

‎test/Factory/ApplicationFactoryTest.php‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
use Symfony\Component\EventDispatcher\EventDispatcher;
2020
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
2121

22+
use function sprintf;
23+
2224
class ApplicationFactoryTest extends TestCase
2325
{
2426
use CommonTrait;
@@ -118,7 +120,9 @@ public function testRejectsNonDispatcherService(): void
118120
$container = $this->createContainer()->set(ApplicationFactory::EVENT_DISPATCHER, new stdClass());
119121

120122
$this->expectException(InvalidConfigException::class);
121-
$this->expectExceptionMessage(InvalidConfigException::MESSAGE_INVALID_EVENT_DISPATCHER);
123+
$this->expectExceptionMessage(
124+
sprintf(InvalidConfigException::MESSAGE_INVALID_EVENT_DISPATCHER, EventDispatcherInterface::class)
125+
);
122126

123127
(new ApplicationFactory())($container);
124128
}

0 commit comments

Comments
 (0)