bug #17389 [Routing] Fixed correct class name in thrown exception (fixes #17388) (robinvdvleuten)

This PR was merged into the 2.3 branch.

Discussion
----------

[Routing] Fixed correct class name in thrown exception (fixes #17388)

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #17388
| License       | MIT
| Doc PR        |

This fixes the thrown exception. Instead of the complete file contents, the class name is used in the exception message.

Commits
-------

c847feb Fixed correct class name in thrown exception
This commit is contained in:
Fabien Potencier 2016-01-15 17:48:36 +01:00
commit 54442313ae
1 changed files with 1 additions and 1 deletions

View File

@ -120,7 +120,7 @@ abstract class AnnotationClassLoader implements LoaderInterface
$class = new \ReflectionClass($class);
if ($class->isAbstract()) {
throw new \InvalidArgumentException(sprintf('Annotations from class "%s" cannot be read as it is abstract.', $class));
throw new \InvalidArgumentException(sprintf('Annotations from class "%s" cannot be read as it is abstract.', $class->getName()));
}
if ($annot = $this->reader->getClassAnnotation($class, $this->routeAnnotationClass)) {