Ejemplo n.º 1
0
 /**
  * Checks whether the given media type would match
  *
  * @param \PSX\Http\MediaType $mediaType
  * @return boolean
  */
 public function match(MediaType $mediaType)
 {
     return $this->type == '*' && $this->subType == '*' || $this->type == $mediaType->getType() && $this->subType == $mediaType->getSubType() || $this->type == $mediaType->getType() && $this->subType == '*';
 }
Ejemplo n.º 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';
 }
Ejemplo n.º 3
0
Archivo: Xml.php Proyecto: seytar/psx
 public static function isMediaType(MediaType $mediaType)
 {
     return in_array($mediaType->getName(), self::$mediaTypes) || substr($mediaType->getSubType(), -4) == '+xml' || substr($mediaType->getSubType(), -4) == '/xml';
 }