Skip to content

Commit

Permalink
[HttpFoundation] tagged public @api
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Jul 20, 2011
1 parent 311d691 commit 7dcbcbe
Show file tree
Hide file tree
Showing 16 changed files with 464 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Symfony/Component/HttpFoundation/Cookie.php
Expand Up @@ -15,6 +15,8 @@
* Represents a cookie
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*
* @api
*/
class Cookie
{
Expand All @@ -36,6 +38,8 @@ class Cookie
* @param string $domain The domain that the cookie is available to
* @param Boolean $secure Whether the cookie should only be transmitted over a secure HTTPS connection from the client
* @param Boolean $httpOnly Whether the cookie will be made accessible only through the HTTP protocol
*
* @api
*/
public function __construct($name, $value = null, $expire = 0, $path = '/', $domain = null, $secure = false, $httpOnly = true)
{
Expand Down Expand Up @@ -109,6 +113,8 @@ public function __toString()
* Gets the name of the cookie.
*
* @return string
*
* @api
*/
public function getName()
{
Expand All @@ -119,6 +125,8 @@ public function getName()
* Gets the value of the cookie.
*
* @return string
*
* @api
*/
public function getValue()
{
Expand All @@ -129,6 +137,8 @@ public function getValue()
* Gets the domain that the cookie is available to.
*
* @return string
*
* @api
*/
public function getDomain()
{
Expand All @@ -139,6 +149,8 @@ public function getDomain()
* Gets the time the cookie expires.
*
* @return integer
*
* @api
*/
public function getExpiresTime()
{
Expand All @@ -149,6 +161,8 @@ public function getExpiresTime()
* Gets the path on the server in which the cookie will be available on.
*
* @return string
*
* @api
*/
public function getPath()
{
Expand All @@ -159,6 +173,8 @@ public function getPath()
* Checks whether the cookie should only be transmitted over a secure HTTPS connection from the client.
*
* @return Boolean
*
* @api
*/
public function isSecure()
{
Expand All @@ -169,6 +185,8 @@ public function isSecure()
* Checks whether the cookie will be made accessible only through the HTTP protocol.
*
* @return Boolean
*
* @api
*/
public function isHttpOnly()
{
Expand All @@ -179,6 +197,8 @@ public function isHttpOnly()
* Whether this cookie is about to be cleared
*
* @return Boolean
*
* @api
*/
public function isCleared()
{
Expand Down
12 changes: 12 additions & 0 deletions src/Symfony/Component/HttpFoundation/File/File.php
Expand Up @@ -19,6 +19,8 @@
* A file in the file system.
*
* @author Bernhard Schussek <bernhard.schussek@symfony.com>
*
* @api
*/
class File extends \SplFileInfo
{
Expand Down Expand Up @@ -446,6 +448,8 @@ class File extends \SplFileInfo
* @param string $path The path to the file
*
* @throws FileNotFoundException If the given path is not a file
*
* @api
*/
public function __construct($path)
{
Expand All @@ -462,6 +466,8 @@ public function __construct($path)
* If the mime type is unknown, returns null.
*
* @return string|null The guessed extension or null if it cannot be guessed
*
* @api
*/
public function guessExtension()
{
Expand All @@ -478,6 +484,8 @@ public function guessExtension()
* is available on the current operating system.
*
* @return string|null The guessed mime type (i.e. "application/pdf")
*
* @api
*/
public function getMimeType()
{
Expand All @@ -492,6 +500,8 @@ public function getMimeType()
* \SplFileInfo::getExtension() is not available before PHP 5.3.6
*
* @return string The extension
*
* @api
*/
public function getExtension()
{
Expand All @@ -507,6 +517,8 @@ public function getExtension()
* @return File A File object representing the new file
*
* @throws FileException if the target file could not be created
*
* @api
*/
public function move($directory, $name = null)
{
Expand Down
16 changes: 16 additions & 0 deletions src/Symfony/Component/HttpFoundation/File/UploadedFile.php
Expand Up @@ -20,6 +20,8 @@
* @author Bernhard Schussek <bernhard.schussek@symfony.com>
* @author Florian Eckerstorfer <florian@eckerstorfer.org>
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class UploadedFile extends File
{
Expand Down Expand Up @@ -83,6 +85,8 @@ class UploadedFile extends File
*
* @throws FileException If file_uploads is disabled
* @throws FileNotFoundException If the file does not exist
*
* @api
*/
public function __construct($path, $originalName, $mimeType = null, $size = null, $error = null, $test = false)
{
Expand All @@ -108,6 +112,8 @@ public function __construct($path, $originalName, $mimeType = null, $size = null
* Then is should not be considered as a safe value.
*
* @return string|null The original name
*
* @api
*/
public function getClientOriginalName()
{
Expand All @@ -121,6 +127,8 @@ public function getClientOriginalName()
* Then is should not be considered as a safe value.
*
* @return string|null The mime type
*
* @api
*/
public function getClientMimeType()
{
Expand All @@ -134,6 +142,8 @@ public function getClientMimeType()
* Then is should not be considered as a safe value.
*
* @return integer|null The file size
*
* @api
*/
public function getClientSize()
{
Expand All @@ -147,6 +157,8 @@ public function getClientSize()
* Otherwise one of the other UPLOAD_ERR_XXX constants is returned.
*
* @return integer The upload error
*
* @api
*/
public function getError()
{
Expand All @@ -157,6 +169,8 @@ public function getError()
* Returns whether the file was uploaded successfully.
*
* @return Boolean True if no error occurred during uploading
*
* @api
*/
public function isValid()
{
Expand All @@ -172,6 +186,8 @@ public function isValid()
* @return File A File object representing the new file
*
* @throws FileException if the file has not been uploaded via Http
*
* @api
*/
public function move($directory, $name = null)
{
Expand Down
10 changes: 10 additions & 0 deletions src/Symfony/Component/HttpFoundation/FileBag.php
Expand Up @@ -18,6 +18,8 @@
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Bulat Shakirzyanov <mallluhuct@gmail.com>
*
* @api
*/
class FileBag extends ParameterBag
{
Expand All @@ -27,6 +29,8 @@ class FileBag extends ParameterBag
* Constructor.
*
* @param array $parameters An array of HTTP files
*
* @api
*/
public function __construct(array $parameters = array())
{
Expand All @@ -36,6 +40,8 @@ public function __construct(array $parameters = array())
/**
* (non-PHPdoc)
* @see Symfony\Component\HttpFoundation\ParameterBag::replace()
*
* @api
*/
public function replace(array $files = array())
{
Expand All @@ -46,6 +52,8 @@ public function replace(array $files = array())
/**
* (non-PHPdoc)
* @see Symfony\Component\HttpFoundation\ParameterBag::set()
*
* @api
*/
public function set($key, $value)
{
Expand All @@ -57,6 +65,8 @@ public function set($key, $value)
/**
* (non-PHPdoc)
* @see Symfony\Component\HttpFoundation\ParameterBag::add()
*
* @api
*/
public function add(array $files = array())
{
Expand Down
24 changes: 24 additions & 0 deletions src/Symfony/Component/HttpFoundation/HeaderBag.php
Expand Up @@ -15,6 +15,8 @@
* HeaderBag is a container for HTTP headers.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class HeaderBag
{
Expand All @@ -25,6 +27,8 @@ class HeaderBag
* Constructor.
*
* @param array $headers An array of HTTP headers
*
* @api
*/
public function __construct(array $headers = array())
{
Expand Down Expand Up @@ -66,6 +70,8 @@ public function __toString()
* Returns the headers.
*
* @return array An array of headers
*
* @api
*/
public function all()
{
Expand All @@ -76,6 +82,8 @@ public function all()
* Returns the parameter keys.
*
* @return array An array of parameter keys
*
* @api
*/
public function keys()
{
Expand All @@ -86,6 +94,8 @@ public function keys()
* Replaces the current HTTP headers by a new set.
*
* @param array $headers An array of HTTP headers
*
* @api
*/
public function replace(array $headers = array())
{
Expand All @@ -97,6 +107,8 @@ public function replace(array $headers = array())
* Adds new headers the current HTTP headers set.
*
* @param array $headers An array of HTTP headers
*
* @api
*/
public function add(array $headers)
{
Expand All @@ -113,6 +125,8 @@ public function add(array $headers)
* @param Boolean $first Whether to return the first value or all header values
*
* @return string|array The first header value if $first is true, an array of values otherwise
*
* @api
*/
public function get($key, $default = null, $first = true)
{
Expand All @@ -139,6 +153,8 @@ public function get($key, $default = null, $first = true)
* @param string $key The key
* @param string|array $values The value or an array of values
* @param Boolean $replace Whether to replace the actual value of not (true by default)
*
* @api
*/
public function set($key, $values, $replace = true)
{
Expand All @@ -163,6 +179,8 @@ public function set($key, $values, $replace = true)
* @param string $key The HTTP header
*
* @return Boolean true if the parameter exists, false otherwise
*
* @api
*/
public function has($key)
{
Expand All @@ -176,6 +194,8 @@ public function has($key)
* @param string $value The HTTP value
*
* @return Boolean true if the value is contained in the header, false otherwise
*
* @api
*/
public function contains($key, $value)
{
Expand All @@ -186,6 +206,8 @@ public function contains($key, $value)
* Removes a header.
*
* @param string $key The HTTP header name
*
* @api
*/
public function remove($key)
{
Expand All @@ -205,6 +227,8 @@ public function remove($key)
* @param \DateTime $default The default value
*
* @return \DateTime The filtered value
*
* @api
*/
public function getDate($key, \DateTime $default = null)
{
Expand Down

0 comments on commit 7dcbcbe

Please sign in to comment.