partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

ExceptionWrapperHandler.php (602B)


      1 <?php
      2 
      3 namespace PartKeepr\DoctrineReflectionBundle\Exception;
      4 
      5 use FOS\RestBundle\View\ExceptionWrapperHandlerInterface;
      6 
      7 // @todo check if this is obsolete
      8 class ExceptionWrapperHandler implements ExceptionWrapperHandlerInterface
      9 {
     10     /**
     11      * @param array $data
     12      *
     13      * @return array
     14      */
     15     public function wrap($data)
     16     {
     17         $data = [
     18             '@type'             => 'Error',
     19             'hydra:title'       => isset($context['title']) ? $context['title'] : 'An error occurred',
     20             'hydra:description' => $data['message'],
     21         ];
     22 
     23         return $data;
     24     }
     25 }