@@ -9,19 +9,19 @@ |
||
| 9 | 9 | |
| 10 | 10 | class Request implements RequestInterface |
| 11 | 11 | { |
| 12 | - /** |
|
| 13 | - * get parameter |
|
| 14 | - * @param string $name |
|
| 15 | - * @param string $default |
|
| 16 | - * @return string |
|
| 17 | - */ |
|
| 18 | - public function get(string $name, string $default = null) : string |
|
| 19 | - { |
|
| 20 | - if (isset($_POST[$name]) && $_POST[$name] != '') { |
|
| 21 | - return $_POST[$name]; |
|
| 22 | - } |
|
| 23 | - else if ($default !== null) { |
|
| 24 | - return $default; |
|
| 25 | - } |
|
| 26 | - } |
|
| 12 | + /** |
|
| 13 | + * get parameter |
|
| 14 | + * @param string $name |
|
| 15 | + * @param string $default |
|
| 16 | + * @return string |
|
| 17 | + */ |
|
| 18 | + public function get(string $name, string $default = null) : string |
|
| 19 | + { |
|
| 20 | + if (isset($_POST[$name]) && $_POST[$name] != '') { |
|
| 21 | + return $_POST[$name]; |
|
| 22 | + } |
|
| 23 | + else if ($default !== null) { |
|
| 24 | + return $default; |
|
| 25 | + } |
|
| 26 | + } |
|
| 27 | 27 | } |
@@ -19,8 +19,7 @@ |
||
| 19 | 19 | { |
| 20 | 20 | if (isset($_POST[$name]) && $_POST[$name] != '') { |
| 21 | 21 | return $_POST[$name]; |
| 22 | - } |
|
| 23 | - else if ($default !== null) { |
|
| 22 | + } else if ($default !== null) { |
|
| 24 | 23 | return $default; |
| 25 | 24 | } |
| 26 | 25 | } |
@@ -9,19 +9,19 @@ |
||
| 9 | 9 | |
| 10 | 10 | class Query implements RequestInterface |
| 11 | 11 | { |
| 12 | - /** |
|
| 13 | - * get parameter |
|
| 14 | - * @param string $name |
|
| 15 | - * @param string $default |
|
| 16 | - * @return string |
|
| 17 | - */ |
|
| 18 | - public function get(string $name, string $default = null) : string |
|
| 19 | - { |
|
| 20 | - if (isset($_GET[$name]) && $_GET[$name] != '') { |
|
| 21 | - return $_GET[$name]; |
|
| 22 | - } |
|
| 23 | - else if ($default !== null) { |
|
| 24 | - return $default; |
|
| 25 | - } |
|
| 26 | - } |
|
| 12 | + /** |
|
| 13 | + * get parameter |
|
| 14 | + * @param string $name |
|
| 15 | + * @param string $default |
|
| 16 | + * @return string |
|
| 17 | + */ |
|
| 18 | + public function get(string $name, string $default = null) : string |
|
| 19 | + { |
|
| 20 | + if (isset($_GET[$name]) && $_GET[$name] != '') { |
|
| 21 | + return $_GET[$name]; |
|
| 22 | + } |
|
| 23 | + else if ($default !== null) { |
|
| 24 | + return $default; |
|
| 25 | + } |
|
| 26 | + } |
|
| 27 | 27 | } |
@@ -19,8 +19,7 @@ |
||
| 19 | 19 | { |
| 20 | 20 | if (isset($_GET[$name]) && $_GET[$name] != '') { |
| 21 | 21 | return $_GET[$name]; |
| 22 | - } |
|
| 23 | - else if ($default !== null) { |
|
| 22 | + } else if ($default !== null) { |
|
| 24 | 23 | return $default; |
| 25 | 24 | } |
| 26 | 25 | } |
@@ -9,19 +9,19 @@ |
||
| 9 | 9 | |
| 10 | 10 | class Cookies implements RequestInterface |
| 11 | 11 | { |
| 12 | - /** |
|
| 13 | - * get parameter |
|
| 14 | - * @param string $name |
|
| 15 | - * @param string $default |
|
| 16 | - * @return string |
|
| 17 | - */ |
|
| 18 | - public function get(string $name, string $default = null) : string |
|
| 19 | - { |
|
| 20 | - if (isset($_COOKIE[$name]) && $_COOKIE[$name] != '') { |
|
| 21 | - return $_COOKIE[$name]; |
|
| 22 | - } |
|
| 23 | - else if ($default !== null) { |
|
| 24 | - return $default; |
|
| 25 | - } |
|
| 26 | - } |
|
| 12 | + /** |
|
| 13 | + * get parameter |
|
| 14 | + * @param string $name |
|
| 15 | + * @param string $default |
|
| 16 | + * @return string |
|
| 17 | + */ |
|
| 18 | + public function get(string $name, string $default = null) : string |
|
| 19 | + { |
|
| 20 | + if (isset($_COOKIE[$name]) && $_COOKIE[$name] != '') { |
|
| 21 | + return $_COOKIE[$name]; |
|
| 22 | + } |
|
| 23 | + else if ($default !== null) { |
|
| 24 | + return $default; |
|
| 25 | + } |
|
| 26 | + } |
|
| 27 | 27 | } |
@@ -19,8 +19,7 @@ |
||
| 19 | 19 | { |
| 20 | 20 | if (isset($_COOKIE[$name]) && $_COOKIE[$name] != '') { |
| 21 | 21 | return $_COOKIE[$name]; |
| 22 | - } |
|
| 23 | - else if ($default !== null) { |
|
| 22 | + } else if ($default !== null) { |
|
| 24 | 23 | return $default; |
| 25 | 24 | } |
| 26 | 25 | } |
@@ -148,6 +148,6 @@ |
||
| 148 | 148 | */ |
| 149 | 149 | private static function _applyCode(string $sContent, string $sCode) : string |
| 150 | 150 | { |
| 151 | - return "\033[" . $sCode . "m" . $sContent . "\033[0m\n"; |
|
| 151 | + return "\033[".$sCode."m".$sContent."\033[0m\n"; |
|
| 152 | 152 | } |
| 153 | 153 | } |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | { |
| 38 | 38 | if ( is_object($mObject)) { |
| 39 | 39 | |
| 40 | - $mObject = (array) $mObject; |
|
| 40 | + $mObject = (array) $mObject; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | |
@@ -35,9 +35,9 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public static function object_to_array($mObject) : array |
| 37 | 37 | { |
| 38 | - if ( is_object($mObject)) { |
|
| 38 | + if (is_object($mObject)) { |
|
| 39 | 39 | |
| 40 | - $mObject = (array) $mObject; |
|
| 40 | + $mObject = (array)$mObject; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | $aNew = array(); |
| 47 | 47 | |
| 48 | - foreach($mObject as $sKey => $mValues) { |
|
| 48 | + foreach ($mObject as $sKey => $mValues) { |
|
| 49 | 49 | |
| 50 | 50 | $sKey = preg_replace("/^\\0(.*)\\0/", "", $sKey); |
| 51 | 51 | $aNew[$sKey] = self::object_to_array($mValues); |
@@ -50,8 +50,7 @@ |
||
| 50 | 50 | $sKey = preg_replace("/^\\0(.*)\\0/", "", $sKey); |
| 51 | 51 | $aNew[$sKey] = self::object_to_array($mValues); |
| 52 | 52 | } |
| 53 | - } |
|
| 54 | - else { |
|
| 53 | + } else { |
|
| 55 | 54 | |
| 56 | 55 | $aNew = $mObject; |
| 57 | 56 | } |
@@ -7,12 +7,12 @@ |
||
| 7 | 7 | */ |
| 8 | 8 | class LogLevel |
| 9 | 9 | { |
| 10 | - const EMERGENCY = 'emergency'; |
|
| 11 | - const ALERT = 'alert'; |
|
| 12 | - const CRITICAL = 'critical'; |
|
| 13 | - const ERROR = 'error'; |
|
| 14 | - const WARNING = 'warning'; |
|
| 15 | - const NOTICE = 'notice'; |
|
| 16 | - const INFO = 'info'; |
|
| 17 | - const DEBUG = 'debug'; |
|
| 10 | + const EMERGENCY = 'emergency'; |
|
| 11 | + const ALERT = 'alert'; |
|
| 12 | + const CRITICAL = 'critical'; |
|
| 13 | + const ERROR = 'error'; |
|
| 14 | + const WARNING = 'warning'; |
|
| 15 | + const NOTICE = 'notice'; |
|
| 16 | + const INFO = 'info'; |
|
| 17 | + const DEBUG = 'debug'; |
|
| 18 | 18 | } |
@@ -19,96 +19,96 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | interface LoggerInterface |
| 21 | 21 | { |
| 22 | - /** |
|
| 23 | - * System is unusable. |
|
| 24 | - * |
|
| 25 | - * @param string $message |
|
| 26 | - * @param array $context |
|
| 27 | - * @return null |
|
| 28 | - */ |
|
| 29 | - public function emergency($message, array $context = array()); |
|
| 22 | + /** |
|
| 23 | + * System is unusable. |
|
| 24 | + * |
|
| 25 | + * @param string $message |
|
| 26 | + * @param array $context |
|
| 27 | + * @return null |
|
| 28 | + */ |
|
| 29 | + public function emergency($message, array $context = array()); |
|
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * Action must be taken immediately. |
|
| 33 | - * |
|
| 34 | - * Example: Entire website down, database unavailable, etc. This should |
|
| 35 | - * trigger the SMS alerts and wake you up. |
|
| 36 | - * |
|
| 37 | - * @param string $message |
|
| 38 | - * @param array $context |
|
| 39 | - * @return null |
|
| 40 | - */ |
|
| 41 | - public function alert($message, array $context = array()); |
|
| 31 | + /** |
|
| 32 | + * Action must be taken immediately. |
|
| 33 | + * |
|
| 34 | + * Example: Entire website down, database unavailable, etc. This should |
|
| 35 | + * trigger the SMS alerts and wake you up. |
|
| 36 | + * |
|
| 37 | + * @param string $message |
|
| 38 | + * @param array $context |
|
| 39 | + * @return null |
|
| 40 | + */ |
|
| 41 | + public function alert($message, array $context = array()); |
|
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * Critical conditions. |
|
| 45 | - * |
|
| 46 | - * Example: Application component unavailable, unexpected exception. |
|
| 47 | - * |
|
| 48 | - * @param string $message |
|
| 49 | - * @param array $context |
|
| 50 | - * @return null |
|
| 51 | - */ |
|
| 52 | - public function critical($message, array $context = array()); |
|
| 43 | + /** |
|
| 44 | + * Critical conditions. |
|
| 45 | + * |
|
| 46 | + * Example: Application component unavailable, unexpected exception. |
|
| 47 | + * |
|
| 48 | + * @param string $message |
|
| 49 | + * @param array $context |
|
| 50 | + * @return null |
|
| 51 | + */ |
|
| 52 | + public function critical($message, array $context = array()); |
|
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * Runtime errors that do not require immediate action but should typically |
|
| 56 | - * be logged and monitored. |
|
| 57 | - * |
|
| 58 | - * @param string $message |
|
| 59 | - * @param array $context |
|
| 60 | - * @return null |
|
| 61 | - */ |
|
| 62 | - public function error($message, array $context = array()); |
|
| 54 | + /** |
|
| 55 | + * Runtime errors that do not require immediate action but should typically |
|
| 56 | + * be logged and monitored. |
|
| 57 | + * |
|
| 58 | + * @param string $message |
|
| 59 | + * @param array $context |
|
| 60 | + * @return null |
|
| 61 | + */ |
|
| 62 | + public function error($message, array $context = array()); |
|
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * Exceptional occurrences that are not errors. |
|
| 66 | - * |
|
| 67 | - * Example: Use of deprecated APIs, poor use of an API, undesirable things |
|
| 68 | - * that are not necessarily wrong. |
|
| 69 | - * |
|
| 70 | - * @param string $message |
|
| 71 | - * @param array $context |
|
| 72 | - * @return null |
|
| 73 | - */ |
|
| 74 | - public function warning($message, array $context = array()); |
|
| 64 | + /** |
|
| 65 | + * Exceptional occurrences that are not errors. |
|
| 66 | + * |
|
| 67 | + * Example: Use of deprecated APIs, poor use of an API, undesirable things |
|
| 68 | + * that are not necessarily wrong. |
|
| 69 | + * |
|
| 70 | + * @param string $message |
|
| 71 | + * @param array $context |
|
| 72 | + * @return null |
|
| 73 | + */ |
|
| 74 | + public function warning($message, array $context = array()); |
|
| 75 | 75 | |
| 76 | - /** |
|
| 77 | - * Normal but significant events. |
|
| 78 | - * |
|
| 79 | - * @param string $message |
|
| 80 | - * @param array $context |
|
| 81 | - * @return null |
|
| 82 | - */ |
|
| 83 | - public function notice($message, array $context = array()); |
|
| 76 | + /** |
|
| 77 | + * Normal but significant events. |
|
| 78 | + * |
|
| 79 | + * @param string $message |
|
| 80 | + * @param array $context |
|
| 81 | + * @return null |
|
| 82 | + */ |
|
| 83 | + public function notice($message, array $context = array()); |
|
| 84 | 84 | |
| 85 | - /** |
|
| 86 | - * Interesting events. |
|
| 87 | - * |
|
| 88 | - * Example: User logs in, SQL logs. |
|
| 89 | - * |
|
| 90 | - * @param string $message |
|
| 91 | - * @param array $context |
|
| 92 | - * @return null |
|
| 93 | - */ |
|
| 94 | - public function info($message, array $context = array()); |
|
| 85 | + /** |
|
| 86 | + * Interesting events. |
|
| 87 | + * |
|
| 88 | + * Example: User logs in, SQL logs. |
|
| 89 | + * |
|
| 90 | + * @param string $message |
|
| 91 | + * @param array $context |
|
| 92 | + * @return null |
|
| 93 | + */ |
|
| 94 | + public function info($message, array $context = array()); |
|
| 95 | 95 | |
| 96 | - /** |
|
| 97 | - * Detailed debug information. |
|
| 98 | - * |
|
| 99 | - * @param string $message |
|
| 100 | - * @param array $context |
|
| 101 | - * @return null |
|
| 102 | - */ |
|
| 103 | - public function debug($message, array $context = array()); |
|
| 96 | + /** |
|
| 97 | + * Detailed debug information. |
|
| 98 | + * |
|
| 99 | + * @param string $message |
|
| 100 | + * @param array $context |
|
| 101 | + * @return null |
|
| 102 | + */ |
|
| 103 | + public function debug($message, array $context = array()); |
|
| 104 | 104 | |
| 105 | - /** |
|
| 106 | - * Logs with an arbitrary level. |
|
| 107 | - * |
|
| 108 | - * @param mixed $level |
|
| 109 | - * @param string $message |
|
| 110 | - * @param array $context |
|
| 111 | - * @return null |
|
| 112 | - */ |
|
| 113 | - public function log($level, $message, array $context = array()); |
|
| 105 | + /** |
|
| 106 | + * Logs with an arbitrary level. |
|
| 107 | + * |
|
| 108 | + * @param mixed $level |
|
| 109 | + * @param string $message |
|
| 110 | + * @param array $context |
|
| 111 | + * @return null |
|
| 112 | + */ |
|
| 113 | + public function log($level, $message, array $context = array()); |
|
| 114 | 114 | } |
@@ -32,37 +32,37 @@ |
||
| 32 | 32 | */ |
| 33 | 33 | class Demo extends Controller |
| 34 | 34 | { |
| 35 | - /** |
|
| 36 | - * Constructor |
|
| 37 | - * |
|
| 38 | - * @access public |
|
| 39 | - * @return Demo |
|
| 40 | - */ |
|
| 41 | - public function __construct() |
|
| 42 | - { |
|
| 43 | - parent::__construct(); |
|
| 44 | - } |
|
| 35 | + /** |
|
| 36 | + * Constructor |
|
| 37 | + * |
|
| 38 | + * @access public |
|
| 39 | + * @return Demo |
|
| 40 | + */ |
|
| 41 | + public function __construct() |
|
| 42 | + { |
|
| 43 | + parent::__construct(); |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * bootstrap |
|
| 48 | - * |
|
| 49 | - * @access public |
|
| 50 | - * @return void |
|
| 51 | - */ |
|
| 52 | - public function bootstrap() |
|
| 53 | - { |
|
| 54 | - ; |
|
| 55 | - } |
|
| 46 | + /** |
|
| 47 | + * bootstrap |
|
| 48 | + * |
|
| 49 | + * @access public |
|
| 50 | + * @return void |
|
| 51 | + */ |
|
| 52 | + public function bootstrap() |
|
| 53 | + { |
|
| 54 | + ; |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * install method |
|
| 59 | - * |
|
| 60 | - * @access public |
|
| 61 | - * @param string $sPortal |
|
| 62 | - * @return void |
|
| 63 | - */ |
|
| 64 | - public function install($sPortal) |
|
| 65 | - { |
|
| 66 | - $this->installDb; |
|
| 67 | - } |
|
| 57 | + /** |
|
| 58 | + * install method |
|
| 59 | + * |
|
| 60 | + * @access public |
|
| 61 | + * @param string $sPortal |
|
| 62 | + * @return void |
|
| 63 | + */ |
|
| 64 | + public function install($sPortal) |
|
| 65 | + { |
|
| 66 | + $this->installDb; |
|
| 67 | + } |
|
| 68 | 68 | } |