Skip to content

Commit

Permalink
Fix solution text
Browse files Browse the repository at this point in the history
  • Loading branch information
np25071984 committed Jan 13, 2025
1 parent bb56b6f commit 25e7c29
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/NotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,13 @@ public function getBuildStack(): array

public function getName(): string
{
return sprintf('No difinition or class found for "%s" ID.', $this->id);
return sprintf('No definition or class found for "%s" ID.', $this->id);
}

public function getSolution(): ?string
{
$solution = <<<SOLUTION
Ensure that either a service with ID "%1\$s" is defined or such class exists and is autoloadable.
Ensure that configuration for service with ID "%1\$s" is correct.
SOLUTION;

return sprintf($solution, $this->id);
Expand Down
4 changes: 1 addition & 3 deletions tests/Unit/NotFoundExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ public function testGetId(): void
$exception = new NotFoundException('test');

$this->assertSame('test', $exception->getId());
$this->assertSame('No difinition or class found for "test" ID.', $exception->getName());
$this->assertSame('No definition or class found for "test" ID.', $exception->getName());
$this->assertSame(
<<<SOLUTION
Ensure that either a service with ID "test" is defined or such class exists and is autoloadable.
Ensure that configuration for service with ID "test" is correct.
SOLUTION,
$exception->getSolution()
);
Expand Down

0 comments on commit 25e7c29

Please sign in to comment.