Skip to content

Commit

Permalink
Merge pull request #255 from Rican7/bugfix/doc-block-cleanup
Browse files Browse the repository at this point in the history
Bugfix - Doc-block cleanup
  • Loading branch information
Rican7 committed Nov 7, 2014
2 parents 0d150ef + 7914a91 commit f9fc039
Show file tree
Hide file tree
Showing 51 changed files with 129 additions and 558 deletions.
61 changes: 12 additions & 49 deletions src/Klein/AbstractResponse.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Klein (klein.php) - A lightning fast router for PHP
* Klein (klein.php) - A fast & flexible router for PHP
*
* @author Chris O'Hara <[email protected]>
* @author Trevor Suarez (Rican7) (contributor and v2 refactorer)
Expand All @@ -19,9 +19,6 @@

/**
* AbstractResponse
*
* @abstract
* @package Klein
*/
abstract class AbstractResponse
{
Expand All @@ -33,74 +30,64 @@ abstract class AbstractResponse
/**
* The default response HTTP status code
*
* @static
* @var int
* @access protected
* @type int
*/
protected static $default_status_code = 200;

/**
* The HTTP version of the response
*
* @var string
* @access protected
* @type string
*/
protected $protocol_version = '1.1';

/**
* The response body
*
* @var string
* @access protected
* @type string
*/
protected $body;

/**
* HTTP response status
*
* @var \Klein\HttpStatus
* @access protected
* @type HttpStatus
*/
protected $status;

/**
* HTTP response headers
*
* @var \Klein\DataCollection\HeaderDataCollection
* @access protected
* @type HeaderDataCollection
*/
protected $headers;

/**
* HTTP response cookies
*
* @var \Klein\DataCollection\ResponseCookieDataCollection
* @access protected
* @type ResponseCookieDataCollection
*/
protected $cookies;

/**
* Whether or not the response is "locked" from
* any further modification
*
* @var boolean
* @access protected
* @type boolean
*/
protected $locked = false;

/**
* Whether or not the response has been sent
*
* @var boolean
* @access protected
* @type boolean
*/
protected $sent = false;

/**
* Whether the response has been chunked or not
*
* @var boolean
* @access public
* @type boolean
*/
public $chunked = false;

Expand All @@ -117,7 +104,6 @@ abstract class AbstractResponse
* @param string $body The response body's content
* @param int $status_code The status code
* @param array $headers The response header "hash"
* @access public
*/
public function __construct($body = '', $status_code = null, array $headers = array())
{
Expand All @@ -139,7 +125,6 @@ public function __construct($body = '', $status_code = null, array $headers = ar
* was provided by the argument.
*
* @param string $protocol_version
* @access public
* @return string|AbstractResponse
*/
public function protocolVersion($protocol_version = null)
Expand All @@ -163,7 +148,6 @@ public function protocolVersion($protocol_version = null)
* Calling with an argument, however, sets the response body to what was provided by the argument.
*
* @param string $body The body content string
* @access public
* @return string|AbstractResponse
*/
public function body($body = null)
Expand All @@ -183,7 +167,6 @@ public function body($body = null)
/**
* Returns the status object
*
* @access public
* @return \Klein\HttpStatus
*/
public function status()
Expand All @@ -194,8 +177,7 @@ public function status()
/**
* Returns the headers collection
*
* @access public
* @return \Klein\DataCollection\HeaderDataCollection
* @return HeaderDataCollection
*/
public function headers()
{
Expand All @@ -205,8 +187,7 @@ public function headers()
/**
* Returns the cookies collection
*
* @access public
* @return \Klein\DataCollection\ResponseCookieDataCollection
* @return ResponseCookieDataCollection
*/
public function cookies()
{
Expand All @@ -221,7 +202,6 @@ public function cookies()
* was provided by the argument.
*
* @param int $code The HTTP status code to send
* @access public
* @return int|AbstractResponse
*/
public function code($code = null)
Expand All @@ -242,7 +222,6 @@ public function code($code = null)
* Prepend a string to the response's content body
*
* @param string $content The string to prepend
* @access public
* @return AbstractResponse
*/
public function prepend($content)
Expand All @@ -259,7 +238,6 @@ public function prepend($content)
* Append a string to the response's content body
*
* @param string $content The string to append
* @access public
* @return AbstractResponse
*/
public function append($content)
Expand All @@ -275,7 +253,6 @@ public function append($content)
/**
* Check if the response is locked
*
* @access public
* @return boolean
*/
public function isLocked()
Expand All @@ -291,7 +268,6 @@ public function isLocked()
* when its locked
*
* @throws LockedResponseException If the response is locked
* @access public
* @return AbstractResponse
*/
public function requireUnlocked()
Expand All @@ -306,7 +282,6 @@ public function requireUnlocked()
/**
* Lock the response from further modification
*
* @access public
* @return AbstractResponse
*/
public function lock()
Expand All @@ -319,7 +294,6 @@ public function lock()
/**
* Unlock the response from further modification
*
* @access public
* @return AbstractResponse
*/
public function unlock()
Expand All @@ -334,7 +308,6 @@ public function unlock()
*
* Creates the string based off of the response's properties
*
* @access protected
* @return string
*/
protected function httpStatusLine()
Expand All @@ -347,7 +320,6 @@ protected function httpStatusLine()
*
* @param boolean $cookies_also Whether or not to also send the cookies after sending the normal headers
* @param boolean $override Whether or not to override the check if headers have already been sent
* @access public
* @return AbstractResponse
*/
public function sendHeaders($cookies_also = true, $override = false)
Expand Down Expand Up @@ -375,7 +347,6 @@ public function sendHeaders($cookies_also = true, $override = false)
* Send our HTTP response cookies
*
* @param boolean $override Whether or not to override the check if headers have already been sent
* @access public
* @return AbstractResponse
*/
public function sendCookies($override = false)
Expand Down Expand Up @@ -404,7 +375,6 @@ public function sendCookies($override = false)
/**
* Send our body's contents
*
* @access public
* @return AbstractResponse
*/
public function sendBody()
Expand All @@ -419,7 +389,6 @@ public function sendBody()
*
* @param boolean $override Whether or not to override the check if the response has already been sent
* @throws ResponseAlreadySentException If the response has already been sent
* @access public
* @return AbstractResponse
*/
public function send($override = false)
Expand Down Expand Up @@ -449,7 +418,6 @@ public function send($override = false)
/**
* Check if the response has been sent
*
* @access public
* @return boolean
*/
public function isSent()
Expand All @@ -462,7 +430,6 @@ public function isSent()
*
* @link https://github.com/chriso/klein.php/wiki/Response-Chunking
* @link http://bit.ly/hg3gHb
* @access public
* @return AbstractResponse
*/
public function chunk()
Expand All @@ -489,7 +456,6 @@ public function chunk()
*
* @param string $key The name of the HTTP response header
* @param mixed $value The value to set the header with
* @access public
* @return AbstractResponse
*/
public function header($key, $value)
Expand All @@ -509,7 +475,6 @@ public function header($key, $value)
* @param string $domain The domain of which to restrict the cookie
* @param boolean $secure Flag of whether the cookie should only be sent over a HTTPS connection
* @param boolean $httponly Flag of whether the cookie should only be accessible over the HTTP protocol
* @access public
* @return AbstractResponse
*/
public function cookie(
Expand All @@ -536,7 +501,6 @@ public function cookie(
/**
* Tell the browser not to cache the response
*
* @access public
* @return AbstractResponse
*/
public function noCache()
Expand All @@ -552,7 +516,6 @@ public function noCache()
*
* @param string $url The URL to redirect to
* @param int $code The HTTP status code to use for redirection
* @access public
* @return AbstractResponse
*/
public function redirect($url, $code = 302)
Expand Down
14 changes: 2 additions & 12 deletions src/Klein/AbstractRouteFactory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Klein (klein.php) - A lightning fast router for PHP
* Klein (klein.php) - A fast & flexible router for PHP
*
* @author Chris O'Hara <[email protected]>
* @author Trevor Suarez (Rican7) (contributor and v2 refactorer)
Expand All @@ -15,9 +15,6 @@
* AbstractRouteFactory
*
* Abstract class for a factory for building new Route instances
*
* @abstract
* @package Klein
*/
abstract class AbstractRouteFactory
{
Expand All @@ -31,8 +28,7 @@ abstract class AbstractRouteFactory
* when matching, so you can define routes under a
* common endpoint
*
* @var string
* @access protected
* @type string
*/
protected $namespace;

Expand All @@ -45,7 +41,6 @@ abstract class AbstractRouteFactory
* Constructor
*
* @param string $namespace The initial namespace to set
* @access public
*/
public function __construct($namespace = null)
{
Expand All @@ -55,7 +50,6 @@ public function __construct($namespace = null)
/**
* Gets the value of namespace
*
* @access public
* @return string
*/
public function getNamespace()
Expand All @@ -67,7 +61,6 @@ public function getNamespace()
* Sets the value of namespace
*
* @param string $namespace The namespace from which to collect the Routes under
* @access public
* @return AbstractRouteFactory
*/
public function setNamespace($namespace)
Expand All @@ -81,7 +74,6 @@ public function setNamespace($namespace)
* Append a namespace to the current namespace
*
* @param string $namespace The namespace from which to collect the Routes under
* @access public
* @return AbstractRouteFactory
*/
public function appendNamespace($namespace)
Expand All @@ -101,8 +93,6 @@ public function appendNamespace($namespace)
* @param string|array $method HTTP Method to match
* @param boolean $count_match Whether or not to count the route as a match when counting total matches
* @param string $name The name of the route
* @abstract
* @access public
* @return Route
*/
abstract public function build($callback, $path = null, $method = null, $count_match = true, $name = null);
Expand Down
Loading

0 comments on commit f9fc039

Please sign in to comment.