fix calendar css, take 2. (#213)
[openemr.git] / interface / modules / zend_modules / library / Zend / Http / Header / Authorization.php
blob4a5bcfd6232c64864e281202b21868682b3691ba
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Http\Header;
12 /**
13 * @throws Exception\InvalidArgumentException
14 * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.8
16 class Authorization implements HeaderInterface
18 /**
19 * @var string
21 protected $value;
23 public static function fromString($headerLine)
25 list($name, $value) = GenericHeader::splitHeaderLine($headerLine);
27 // check to ensure proper header type for this factory
28 if (strtolower($name) !== 'authorization') {
29 throw new Exception\InvalidArgumentException(sprintf(
30 'Invalid header line for Authorization string: "%s"',
31 $name
32 ));
35 // @todo implementation details
36 $header = new static($value);
38 return $header;
41 public function __construct($value = null)
43 if ($value) {
44 HeaderValue::assertValid($value);
45 $this->value = $value;
49 public function getFieldName()
51 return 'Authorization';
54 public function getFieldValue()
56 return $this->value;
59 public function toString()
61 return 'Authorization: ' . $this->getFieldValue();