コード例 #1
0
ファイル: Callback.php プロジェクト: seytar/psx
 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;
 }
コード例 #2
0
ファイル: XmlArray.php プロジェクト: seytar/psx
 public function accept(MediaType $contentType)
 {
     return in_array($contentType->getName(), MediaType\Xml::getMediaTypes()) || substr($contentType->getSubType(), -4) == '+xml' || substr($contentType->getSubType(), -4) == '/xml';
 }
コード例 #3
0
ファイル: Jsonx.php プロジェクト: seytar/psx
 public function isContentTypeSupported(MediaType $contentType)
 {
     return $contentType->getName() == self::$mime;
 }
コード例 #4
0
ファイル: Jsonx.php プロジェクト: seytar/psx
 public function accept(MediaType $contentType)
 {
     return $contentType->getName() == 'application/jsonx+xml';
 }
コード例 #5
0
ファイル: Form.php プロジェクト: seytar/psx
 public function isContentTypeSupported(MediaType $contentType)
 {
     return $contentType->getName() == 'application/x-www-form-urlencoded';
 }
コード例 #6
0
ファイル: Xml.php プロジェクト: 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';
 }