summaryrefslogtreecommitdiff
path: root/core/helpers/rest.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-01-14 04:12:02 +0000
committerBharat Mediratta <bharat@menalto.com>2009-01-14 04:12:02 +0000
commitf3ba69c1d67c425ffa180d082a373e5cce0c86ce (patch)
tree5ecbbe0ba96a94e3f4aadd26042c8ad1a32ef1bc /core/helpers/rest.php
parent02af2d8b7639fdc18fba3d69a4ca0a3f5c92b948 (diff)
Make sure that helper functions are all static. Add new
File_Structure_Test to make sure we don't regress. According to the PHP docs, the "public" keyword is implied on static functions, so remove it. Also, require private static functions to start with an _. http://php.net/manual/en/language.oop5.visibility.php
Diffstat (limited to 'core/helpers/rest.php')
-rw-r--r--core/helpers/rest.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/helpers/rest.php b/core/helpers/rest.php
index 061c2f6b..51f066eb 100644
--- a/core/helpers/rest.php
+++ b/core/helpers/rest.php
@@ -58,7 +58,7 @@ class rest_Core {
* Returns the HTTP request method taking into consideration PUT/DELETE tunneling.
* @return string HTTP request method
*/
- public static function request_method() {
+ static function request_method() {
Kohana::log("debug", "request::method: " . request::method());
if (request::method() == "get") {
return "get";
@@ -76,7 +76,7 @@ class rest_Core {
* Choose an output format based on what the client prefers to accept.
* @return string "html", "xml" or "json"
*/
- public static function output_format() {
+ static function output_format() {
// Pick a format, but let it be overridden.
$input = Input::instance();
$fmt = $input->get(
@@ -95,7 +95,7 @@ class rest_Core {
* Set HTTP response code.
* @param string Use one of the status code constants defined in this class.
*/
- public static function http_status($status_code) {
+ static function http_status($status_code) {
header("HTTP/1.1 " . $status_code);
}
@@ -103,7 +103,7 @@ class rest_Core {
* Set HTTP Location header.
* @param string URL
*/
- public static function http_location($url) {
+ static function http_location($url) {
header("Location: " . $url);
}
@@ -111,7 +111,7 @@ class rest_Core {
* Set HTTP Content-Type header.
* @param string content type
*/
- public static function http_content_type($type) {
+ static function http_content_type($type) {
header("Content-Type: " . $type);
}
}