diff --git a/src/JMS/ObjectRouting/Metadata/ClassMetadata.php b/src/JMS/ObjectRouting/Metadata/ClassMetadata.php index 615cc00..dc7856e 100644 --- a/src/JMS/ObjectRouting/Metadata/ClassMetadata.php +++ b/src/JMS/ObjectRouting/Metadata/ClassMetadata.php @@ -39,7 +39,7 @@ public function merge(MergeableInterface $object): void $this->routes = array_merge($this->routes, $object->routes); } - public function serialize() + public function serialize(): string { return serialize( array( @@ -49,7 +49,7 @@ public function serialize() ); } - public function unserialize($str) + public function unserialize($str): void { list( $this->routes, diff --git a/src/JMS/ObjectRouting/Twig/RoutingExtension.php b/src/JMS/ObjectRouting/Twig/RoutingExtension.php index 209bad4..e53e58f 100644 --- a/src/JMS/ObjectRouting/Twig/RoutingExtension.php +++ b/src/JMS/ObjectRouting/Twig/RoutingExtension.php @@ -15,7 +15,7 @@ public function __construct(ObjectRouter $router) $this->router = $router; } - public function getFunctions() + public function getFunctions(): array { return [ new TwigFunction('object_path', [$this, 'path']), @@ -23,12 +23,12 @@ public function getFunctions() ]; } - public function url($type, $object, array $extraParams = []) + public function url($type, $object, array $extraParams = []): string { return $this->router->generate($type, $object, true, $extraParams); } - public function path($type, $object, array $extraParams = []) + public function path($type, $object, array $extraParams = []): string { return $this->router->generate($type, $object, false, $extraParams); }