src/AcceptInterceptor.php
public function invoke(MethodInvocation $invocation)
    {
        $produce = $invocation->getMethod()->getAnnotation(Produces::class);
        /* @var $produce \BEAR\Accept\Annotation\Produces */
        $accept = $this->getAccept($this->available['Accept'], $produce->value);
        $accept = new Accept(['Accept' => $accept]);
        list($context, $vary) = $accept->__invoke($_SERVER);
        $renderer = (new AppInjector($this->appMeta->name, $context))->getInstance(RenderInterface::class);
        $ro = $invocation->getThis();
        /* @var $ro \BEAR\Resource\ResourceObject */
        $ro->setRenderer($renderer);
        $ro = $invocation->proceed();
        $ro->headers['Vary'] = $vary;

        return $ro;
    }
public function invoke(MethodInvocation $invocation)
    {
        $produce = $invocation->getMethod()->getAnnotation(Produces::class);
        /* @var $produce \BEAR\Accept\Annotation\Produces */
        $accept = $this->getAccept($this->available['Accept'], $produce->value);
        $accept = new Accept(['Accept' => $accept]);
        list($context, $vary) = $accept->__invoke($_SERVER);
        $renderer = (new AppInjector($this->appMeta->name, $context))->getInstance(RenderInterface::class);
        $ro = $invocation->getThis();
        /* @var $ro \BEAR\Resource\ResourceObject */
        $ro->setRenderer($renderer);
        $ro = $invocation->proceed();
        $ro->headers['Vary'] = $vary;

        return $ro;
    }
public function invoke ( MethodInvocation $ invocation ) { $ produce = $ invocation -> getMethod ( ) -> getAnnotation ( Produces :: class ) ; /* @var $produce \BEAR\Accept\Annotation\Produces */ $ accept = $ this -> getAccept ( $ this -> available [ 'Accept' ] , $ produce -> value ) ; $ accept = new Accept ( [ 'Accept' => $ accept ] ) ; list ( $ context , $ vary ) = $ accept -> __invoke ( $ _SERVER ) ; $ renderer = ( new AppInjector ( $ this -> appMeta -> name , $ context ) ) -> getInstance ( RenderInterface :: class ) ; $ ro = $ invocation -> getThis ( ) ; /* @var $ro \BEAR\Resource\ResourceObject */ $ ro -> setRenderer ( $ renderer ) ; $ ro = $ invocation -> proceed ( ) ; $ ro -> headers [ 'Vary' ] = $ vary ; return $ ro ; }
{@inheritdoc}
{