Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Clean the code of klein.php

Clean the code with K&R (OTBS) style. Several styles were mixed.

For more informations about the convention
http://en.wikipedia.org/wiki/Indent_style#Variant:_1TBS
  • Loading branch information...
commit 7a1f86ae2167c65b4bd5f21b1764910a9ede129a 1 parent f6190e8
@BafS BafS authored
Showing with 12 additions and 11 deletions.
  1. +12 −11 klein.php
View
23 klein.php
@@ -462,7 +462,7 @@ public function markdown($str, $args = null) {
'/\[([^\]]++)\]\(([^\)]++)\)/' => '<a href="$2">$1</a>',
'/\*\*([^\*]++)\*\*/' => '<strong>$1</strong>',
'/\*([^\*]++)\*/' => '<em>$1</em>'
- );
+ );
$str = array_shift($args);
if (is_array($args[0])) {
$args = $args[0];
@@ -516,16 +516,16 @@ public function code($code = null) {
if (null !== $code) {
$this->_code = $code;
- // Do we have the PHP 5.4 "http_response_code" function?
- if (function_exists('http_response_code')) {
- // Have PHP automatically create our HTTP Status header from our code
- http_response_code($code);
- }
- else {
- // Manually create the HTTP Status header
- $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0';
- $this->header("$protocol $code");
- }
+ // Do we have the PHP 5.4 "http_response_code" function?
+ if (function_exists('http_response_code')) {
+ // Have PHP automatically create our HTTP Status header from our code
+ http_response_code($code);
+ }
+ else {
+ // Manually create the HTTP Status header
+ $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0';
+ $this->header("$protocol $code");
+ }
}
return $this->_code;
}
@@ -884,3 +884,4 @@ public function _header($key, $value = null) {
}
_Request::$_headers = _Response::$_headers = new _Headers;
+
Please sign in to comment.
Something went wrong with that request. Please try again.