/**
  * @param mixed  $object
  * @param string $format
  * @param array  $context
  *
  * @return array
  */
 public function normalize($object, $format = null, array $context = [])
 {
     $array = parent::normalize($object, $format, $context);
     if ($object instanceof Request and isset($array[static::KEY_CONTROL])) {
         $control = [];
         if (in_array('short', $array[static::KEY_CONTROL], true)) {
             $control[] = 's';
         }
         if (in_array('gzcompress', $array[static::KEY_CONTROL], true)) {
             $control[] = 'g';
         }
         if (in_array('bzcompress', $array[static::KEY_CONTROL], true)) {
             $control[] = 'b';
         }
         $array[static::KEY_CONTROL] = $control;
     }
     return $array;
 }
Ejemplo n.º 2
0
 /**
  * @param Request|Response $object
  * @param string           $format
  * @param array            $context
  *
  * @return array
  */
 public function normalize($object, $format = null, array $context = [])
 {
     $data = parent::normalize($object, $format, $context);
     return $data;
 }