Skip to content

Commit 711c208

Browse files
authored
fix: exception message in ToolMetadataException (#265)
1 parent 83d916c commit 711c208

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/Chain/Toolbox/Exception/ToolMetadataException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ final class ToolMetadataException extends InvalidArgumentException implements Ex
1111
{
1212
public static function invalidReference(mixed $reference): self
1313
{
14-
return new self(sprintf('The reference "%s" is not a valid as tool.', $reference));
14+
return new self(sprintf('The reference "%s" is not a valid tool.', $reference));
1515
}
1616

1717
public static function missingAttribute(string $className): self

tests/Chain/Toolbox/MetadataFactory/ChainFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected function setUp(): void
4343
public function testGetMetadataNotExistingClass(): void
4444
{
4545
$this->expectException(ToolMetadataException::class);
46-
$this->expectExceptionMessage('The reference "NoClass" is not a valid as tool.');
46+
$this->expectExceptionMessage('The reference "NoClass" is not a valid tool.');
4747

4848
iterator_to_array($this->factory->getMetadata('NoClass'));
4949
}

tests/Chain/Toolbox/MetadataFactory/MemoryFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ final class MemoryFactoryTest extends TestCase
3131
public function getMetadataWithoutTools(): void
3232
{
3333
$this->expectException(ToolMetadataException::class);
34-
$this->expectExceptionMessage('The reference "SomeClass" is not a valid as tool.');
34+
$this->expectExceptionMessage('The reference "SomeClass" is not a valid tool.');
3535

3636
$factory = new MemoryFactory();
3737
iterator_to_array($factory->getMetadata('SomeClass')); // @phpstan-ignore-line Yes, this class does not exist

tests/Chain/Toolbox/MetadataFactory/ReflectionFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected function setUp(): void
4141
public function invalidReferenceNonExistingClass(): void
4242
{
4343
$this->expectException(ToolMetadataException::class);
44-
$this->expectExceptionMessage('The reference "invalid" is not a valid as tool.');
44+
$this->expectExceptionMessage('The reference "invalid" is not a valid tool.');
4545

4646
iterator_to_array($this->factory->getMetadata('invalid')); // @phpstan-ignore-line Yes, this class does not exist
4747
}

0 commit comments

Comments
 (0)