Beispiel #1
0
 public function accept(MediaType $contentType)
 {
     if ($this->contentType === null) {
         return true;
     } elseif (is_string($this->contentType)) {
         return $this->contentType == $contentType->getName();
     } elseif (is_callable($this->contentType)) {
         return call_user_func_array($this->contentType, array($contentType));
     }
     return false;
 }
Beispiel #2
0
 public function accept(MediaType $contentType)
 {
     return in_array($contentType->getName(), MediaType\Xml::getMediaTypes()) || substr($contentType->getSubType(), -4) == '+xml' || substr($contentType->getSubType(), -4) == '/xml';
 }
Beispiel #3
0
 public function isContentTypeSupported(MediaType $contentType)
 {
     return $contentType->getName() == self::$mime;
 }
Beispiel #4
0
 public function accept(MediaType $contentType)
 {
     return $contentType->getName() == 'application/jsonx+xml';
 }
Beispiel #5
0
 public function isContentTypeSupported(MediaType $contentType)
 {
     return $contentType->getName() == 'application/x-www-form-urlencoded';
 }
Beispiel #6
0
 public static function isMediaType(MediaType $mediaType)
 {
     return in_array($mediaType->getName(), self::$mediaTypes) || substr($mediaType->getSubType(), -4) == '+xml' || substr($mediaType->getSubType(), -4) == '/xml';
 }