From dbeb00eae2ad129192e2cd189dc2d3aea562ad91 Mon Sep 17 00:00:00 2001 From: Francis Besset Date: Tue, 20 Sep 2011 22:34:16 +0200 Subject: [PATCH] Added the possibility to add headers for a controller Example: reader->getClassAnnotations($class) as $annotation) { + if ($annotation instanceof Annotation\Header) { + $serviceMethodHeaders[$annotation->getValue()] = $annotation; + } + } + foreach ($class->getMethods() as $method) { $serviceArguments = $serviceHeaders = array(); $serviceMethod = $serviceReturn = null; - foreach ($this->reader->getMethodAnnotations($method) as $i => $annotation) { + foreach ($serviceMethodHeaders as $annotation) { + $serviceHeaders[$annotation->getValue()] = new Definition\Header( + $annotation->getValue(), + $this->getArgumentType($method, $annotation) + ); + } + + foreach ($this->reader->getMethodAnnotations($method) as $annotation) { if ($annotation instanceof Annotation\Header) { - $serviceHeaders[] = new Definition\Header( + $serviceHeaders[$annotation->getValue()] = new Definition\Header( $annotation->getValue(), $this->getArgumentType($method, $annotation) );