-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #255 from Rican7/bugfix/doc-block-cleanup
Bugfix - Doc-block cleanup
- Loading branch information
Showing
51 changed files
with
129 additions
and
558 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -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) | ||
|
@@ -19,9 +19,6 @@ | |
|
||
/** | ||
* AbstractResponse | ||
* | ||
* @abstract | ||
* @package Klein | ||
*/ | ||
abstract class AbstractResponse | ||
{ | ||
|
@@ -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; | ||
|
||
|
@@ -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()) | ||
{ | ||
|
@@ -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) | ||
|
@@ -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) | ||
|
@@ -183,7 +167,6 @@ public function body($body = null) | |
/** | ||
* Returns the status object | ||
* | ||
* @access public | ||
* @return \Klein\HttpStatus | ||
*/ | ||
public function status() | ||
|
@@ -194,8 +177,7 @@ public function status() | |
/** | ||
* Returns the headers collection | ||
* | ||
* @access public | ||
* @return \Klein\DataCollection\HeaderDataCollection | ||
* @return HeaderDataCollection | ||
*/ | ||
public function headers() | ||
{ | ||
|
@@ -205,8 +187,7 @@ public function headers() | |
/** | ||
* Returns the cookies collection | ||
* | ||
* @access public | ||
* @return \Klein\DataCollection\ResponseCookieDataCollection | ||
* @return ResponseCookieDataCollection | ||
*/ | ||
public function cookies() | ||
{ | ||
|
@@ -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) | ||
|
@@ -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) | ||
|
@@ -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) | ||
|
@@ -275,7 +253,6 @@ public function append($content) | |
/** | ||
* Check if the response is locked | ||
* | ||
* @access public | ||
* @return boolean | ||
*/ | ||
public function isLocked() | ||
|
@@ -291,7 +268,6 @@ public function isLocked() | |
* when its locked | ||
* | ||
* @throws LockedResponseException If the response is locked | ||
* @access public | ||
* @return AbstractResponse | ||
*/ | ||
public function requireUnlocked() | ||
|
@@ -306,7 +282,6 @@ public function requireUnlocked() | |
/** | ||
* Lock the response from further modification | ||
* | ||
* @access public | ||
* @return AbstractResponse | ||
*/ | ||
public function lock() | ||
|
@@ -319,7 +294,6 @@ public function lock() | |
/** | ||
* Unlock the response from further modification | ||
* | ||
* @access public | ||
* @return AbstractResponse | ||
*/ | ||
public function unlock() | ||
|
@@ -334,7 +308,6 @@ public function unlock() | |
* | ||
* Creates the string based off of the response's properties | ||
* | ||
* @access protected | ||
* @return string | ||
*/ | ||
protected function httpStatusLine() | ||
|
@@ -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) | ||
|
@@ -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) | ||
|
@@ -404,7 +375,6 @@ public function sendCookies($override = false) | |
/** | ||
* Send our body's contents | ||
* | ||
* @access public | ||
* @return AbstractResponse | ||
*/ | ||
public function sendBody() | ||
|
@@ -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) | ||
|
@@ -449,7 +418,6 @@ public function send($override = false) | |
/** | ||
* Check if the response has been sent | ||
* | ||
* @access public | ||
* @return boolean | ||
*/ | ||
public function isSent() | ||
|
@@ -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() | ||
|
@@ -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) | ||
|
@@ -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( | ||
|
@@ -536,7 +501,6 @@ public function cookie( | |
/** | ||
* Tell the browser not to cache the response | ||
* | ||
* @access public | ||
* @return AbstractResponse | ||
*/ | ||
public function noCache() | ||
|
@@ -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) | ||
|
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 |
---|---|---|
@@ -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) | ||
|
@@ -15,9 +15,6 @@ | |
* AbstractRouteFactory | ||
* | ||
* Abstract class for a factory for building new Route instances | ||
* | ||
* @abstract | ||
* @package Klein | ||
*/ | ||
abstract class AbstractRouteFactory | ||
{ | ||
|
@@ -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; | ||
|
||
|
@@ -45,7 +41,6 @@ abstract class AbstractRouteFactory | |
* Constructor | ||
* | ||
* @param string $namespace The initial namespace to set | ||
* @access public | ||
*/ | ||
public function __construct($namespace = null) | ||
{ | ||
|
@@ -55,7 +50,6 @@ public function __construct($namespace = null) | |
/** | ||
* Gets the value of namespace | ||
* | ||
* @access public | ||
* @return string | ||
*/ | ||
public function getNamespace() | ||
|
@@ -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) | ||
|
@@ -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) | ||
|
@@ -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); | ||
|
Oops, something went wrong.