forked from symfony/symfony
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[http-foundation] Added base content class.
- Loading branch information
Showing
1 changed file
with
92 additions
and
0 deletions.
There are no files selected for viewing
92 changes: 92 additions & 0 deletions
92
src/Symfony/Component/HttpFoundation/Negotiation/Content.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\HttpFoundation\Negotiation; | ||
|
||
/** | ||
* @author Jean-François Simon <contact@jfsimon.fr> | ||
*/ | ||
class Content implements ContentInterface | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
private $type; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $language; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $charset; | ||
|
||
/** | ||
* @var float | ||
*/ | ||
private $quality; | ||
|
||
/** | ||
* @param string $type | ||
* @param string $language | ||
* @param string $charset | ||
* @param float $quality | ||
*/ | ||
public function __construct($type, $language, $charset, $quality = 1) | ||
{ | ||
$this->type = $type; | ||
$this->language = $language; | ||
$this->charset = $charset; | ||
$this->quality = $quality; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getType() | ||
{ | ||
return $this->type; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getLanguage() | ||
{ | ||
return $this->language; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getCharset() | ||
{ | ||
return $this->charset; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function setQuality($quality) | ||
{ | ||
$this->quality = $quality; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
function getQuality() | ||
{ | ||
return $this->quality; | ||
} | ||
} |