Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include AttributeDriver in the default driver chain #11

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/JMS/ObjectRouting/ObjectRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
use Doctrine\Common\Annotations\AnnotationReader;
use JMS\ObjectRouting\Metadata\ClassMetadata;
use JMS\ObjectRouting\Metadata\Driver\AnnotationDriver;
use JMS\ObjectRouting\Metadata\Driver\AttributeDriver;
use Metadata\Driver\DriverChain;
use Metadata\MetadataFactory;
use Metadata\MetadataFactoryInterface;
use Symfony\Component\PropertyAccess\PropertyAccessor;
Expand All @@ -35,9 +37,10 @@ public static function create(RouterInterface $router)
{
return new self(
$router,
new MetadataFactory(
new AnnotationDriver(new AnnotationReader())
)
new MetadataFactory(new DriverChain([
new AttributeDriver(),
new AnnotationDriver(new AnnotationReader()),
]))
);
}

Expand Down Expand Up @@ -98,4 +101,4 @@ public function url($type, $object, array $extraParams = array())
{
return $this->generate($type, $object, true, $extraParams);
}
}
}
Loading