Skip to content

Commit 08ef880

Browse files
committed
change error msg
1 parent 4bf657a commit 08ef880

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ private function createTypeNotFoundMessage(TypedReference $reference, string $la
631631
}
632632

633633
if ($r->isInterface() && !$alternatives) {
634-
$message .= ' Did you create a class that implements this interface?';
634+
$message .= ' Did you create an instantiable class that implements this interface?';
635635
}
636636
}
637637

src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ public function testTypeNotGuessableNoServicesFound()
245245
$pass->process($container);
246246
$this->fail('AutowirePass should have thrown an exception');
247247
} catch (AutowiringFailedException $e) {
248-
$this->assertSame('Cannot autowire service "a": argument "$collision" of method "Symfony\Component\DependencyInjection\Tests\Compiler\CannotBeAutowired::__construct()" references interface "Symfony\Component\DependencyInjection\Tests\Compiler\CollisionInterface" but no such service exists. Did you create a class that implements this interface?', (string) $e->getMessage());
248+
$this->assertSame('Cannot autowire service "a": argument "$collision" of method "Symfony\Component\DependencyInjection\Tests\Compiler\CannotBeAutowired::__construct()" references interface "Symfony\Component\DependencyInjection\Tests\Compiler\CollisionInterface" but no such service exists. Did you create an instantiable class that implements this interface?', (string) $e->getMessage());
249249
}
250250
}
251251

@@ -819,7 +819,7 @@ public function testInterfaceWithNoImplementationSuggestToWriteOne()
819819
$pass->process($container);
820820
$this->fail('AutowirePass should have thrown an exception');
821821
} catch (AutowiringFailedException $e) {
822-
$this->assertSame('Cannot autowire service "my_service": argument "$i" of method "Symfony\Component\DependencyInjection\Tests\Compiler\K::__construct()" references interface "Symfony\Component\DependencyInjection\Tests\Compiler\IInterface" but no such service exists. Did you create a class that implements this interface?', (string) $e->getMessage());
822+
$this->assertSame('Cannot autowire service "my_service": argument "$i" of method "Symfony\Component\DependencyInjection\Tests\Compiler\K::__construct()" references interface "Symfony\Component\DependencyInjection\Tests\Compiler\IInterface" but no such service exists. Did you create an instantiable class that implements this interface?', (string) $e->getMessage());
823823
}
824824
}
825825

0 commit comments

Comments
 (0)