@@ -116,7 +116,7 @@ |
||
| 116 | 116 | /** |
| 117 | 117 | * Dispatch the router |
| 118 | 118 | * @param string[] $args The arguments array. |
| 119 | - * @return boolean True if route was correctly dispatched. |
|
| 119 | + * @return null|boolean True if route was correctly dispatched. |
|
| 120 | 120 | */ |
| 121 | 121 | public static function run($args=null){ |
| 122 | 122 | if($args) { |
@@ -57,6 +57,9 @@ |
||
| 57 | 57 | return true; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | + /** |
|
| 61 | + * @param ErrorException $e |
|
| 62 | + */ |
|
| 60 | 63 | public static function traceException($e){ |
| 61 | 64 | switch(self::$mode){ |
| 62 | 65 | case self::HTML : |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * Load a Template Handler |
| 32 | - * @param class $handler The template handler class instance |
|
| 32 | + * @param View\Adapter $handler The template handler class instance |
|
| 33 | 33 | */ |
| 34 | 34 | public static function using(View\Adapter &$handler){ |
| 35 | 35 | static::$handler = $handler; |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | 71 | * Returns the handler instance |
| 72 | - * @return mixed |
|
| 72 | + * @return View\Adapter |
|
| 73 | 73 | */ |
| 74 | 74 | public static function & handler(){ |
| 75 | 75 | return static::$handler; |
@@ -101,6 +101,11 @@ |
||
| 101 | 101 | $queries = [], |
| 102 | 102 | $last_exec_success = true; |
| 103 | 103 | |
| 104 | + /** |
|
| 105 | + * @param string $dsn |
|
| 106 | + * @param string $username |
|
| 107 | + * @param string $password |
|
| 108 | + */ |
|
| 104 | 109 | public function __construct($dsn, $username=null, $password=null, $options=[]){ |
| 105 | 110 | $this->connection = [ |
| 106 | 111 | 'dsn' => $dsn, |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | /** |
| 91 | 91 | * Check if an response output buffering is active. |
| 92 | - * @return boolean |
|
| 92 | + * @return boolean|null |
|
| 93 | 93 | */ |
| 94 | 94 | public static function isBuffering(){ |
| 95 | 95 | return static::$buffer; |
@@ -113,7 +113,6 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | /** |
| 115 | 115 | * Append a text to the buffer. |
| 116 | - * @param mixed $payload Text to append to the response buffer |
|
| 117 | 116 | */ |
| 118 | 117 | public static function text(){ |
| 119 | 118 | static::type(static::TYPE_TEXT); |
@@ -122,7 +121,6 @@ discard block |
||
| 122 | 121 | |
| 123 | 122 | /** |
| 124 | 123 | * Append an XML string to the buffer. |
| 125 | - * @param mixed $payload Data to append to the response buffer |
|
| 126 | 124 | */ |
| 127 | 125 | public static function xml(){ |
| 128 | 126 | static::type(static::TYPE_XML); |
@@ -131,7 +129,6 @@ discard block |
||
| 131 | 129 | |
| 132 | 130 | /** |
| 133 | 131 | * Append a SVG string to the buffer. |
| 134 | - * @param mixed $payload Data to append to the response buffer |
|
| 135 | 132 | */ |
| 136 | 133 | public static function svg(){ |
| 137 | 134 | static::type(static::TYPE_SVG); |
@@ -140,7 +137,6 @@ discard block |
||
| 140 | 137 | |
| 141 | 138 | /** |
| 142 | 139 | * Append an HTML string to the buffer. |
| 143 | - * @param mixed $payload Data to append to the response buffer |
|
| 144 | 140 | */ |
| 145 | 141 | public static function html(){ |
| 146 | 142 | static::type(static::TYPE_HTML); |
@@ -149,16 +145,21 @@ discard block |
||
| 149 | 145 | |
| 150 | 146 | /** |
| 151 | 147 | * Append a raw string to the buffer. |
| 152 | - * @param mixed $payload Data to append to the response buffer |
|
| 153 | 148 | */ |
| 154 | 149 | public static function add(){ |
| 155 | 150 | static::$payload[] = implode('',func_get_args()); |
| 156 | 151 | } |
| 157 | 152 | |
| 153 | + /** |
|
| 154 | + * @param integer $code |
|
| 155 | + */ |
|
| 158 | 156 | public static function status($code,$message=''){ |
| 159 | 157 | static::header('Status',$message?:$code,$code); |
| 160 | 158 | } |
| 161 | 159 | |
| 160 | + /** |
|
| 161 | + * @param string $name |
|
| 162 | + */ |
|
| 162 | 163 | public static function header($name,$value,$code=null){ |
| 163 | 164 | static::$headers[$name] = [$value,$code]; |
| 164 | 165 | } |
@@ -32,7 +32,6 @@ discard block |
||
| 32 | 32 | * |
| 33 | 33 | * @access public |
| 34 | 34 | * @static |
| 35 | - * @param string $key The session name |
|
| 36 | 35 | * @return string The session value |
| 37 | 36 | */ |
| 38 | 37 | static public function name($name=null){ |
@@ -62,7 +61,7 @@ discard block |
||
| 62 | 61 | * |
| 63 | 62 | * @access public |
| 64 | 63 | * @static |
| 65 | - * @param mixed $key The variable name |
|
| 64 | + * @param string $key The variable name |
|
| 66 | 65 | * @param mixed $value The variable value |
| 67 | 66 | * @return void |
| 68 | 67 | */ |
@@ -80,7 +79,7 @@ discard block |
||
| 80 | 79 | * |
| 81 | 80 | * @access public |
| 82 | 81 | * @static |
| 83 | - * @param mixed $key The variable name |
|
| 82 | + * @param string $key The variable name |
|
| 84 | 83 | * @return void |
| 85 | 84 | */ |
| 86 | 85 | static public function delete($key){ |
@@ -107,7 +106,7 @@ discard block |
||
| 107 | 106 | * |
| 108 | 107 | * @access public |
| 109 | 108 | * @static |
| 110 | - * @return void |
|
| 109 | + * @return boolean |
|
| 111 | 110 | */ |
| 112 | 111 | static public function active(){ |
| 113 | 112 | return session_status() == PHP_SESSION_ACTIVE; |
@@ -18,6 +18,9 @@ |
||
| 18 | 18 | protected static $headers = []; |
| 19 | 19 | protected static $last_info = null; |
| 20 | 20 | |
| 21 | + /** |
|
| 22 | + * @param string $method |
|
| 23 | + */ |
|
| 21 | 24 | protected static function request($method, $url, $data=[], array $headers=[], $data_as_json=false, $username=null, $password = null){ |
| 22 | 25 | $http_method = strtoupper($method); |
| 23 | 26 | $ch = curl_init($url); |
@@ -28,6 +28,9 @@ |
||
| 28 | 28 | return $this->exists($path) ? file_get_contents($this->realPath($path)) : false; |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | + /** |
|
| 32 | + * @param string|false $data |
|
| 33 | + */ |
|
| 31 | 34 | public function write($path, $data){ |
| 32 | 35 | $r_path = $this->realPath($path); |
| 33 | 36 | if ( ! is_dir($r_dir = dirname($r_path)) ) @mkdir($r_dir,0775,true); |
@@ -56,6 +56,9 @@ |
||
| 56 | 56 | class PHPContext { |
| 57 | 57 | protected $data = []; |
| 58 | 58 | |
| 59 | + /** |
|
| 60 | + * @param string $path |
|
| 61 | + */ |
|
| 59 | 62 | public function __construct($data=[], $path=null){ |
| 60 | 63 | $this->data = $data; |
| 61 | 64 | } |