@@ -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){ |
@@ -45,7 +44,7 @@ discard block |
||
45 | 44 | * @access public |
46 | 45 | * @static |
47 | 46 | * @param mixed $key The variable name |
48 | - * @return mixed The variable value |
|
47 | + * @return string The variable value |
|
49 | 48 | */ |
50 | 49 | static public function get($key,$default=null){ |
51 | 50 | if (($active = static::active()) && isset($_SESSION[$key])) { |
@@ -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 @@ discard block |
||
18 | 18 | protected static $queries = []; |
19 | 19 | protected static $last_exec_success = true; |
20 | 20 | |
21 | + /** |
|
22 | + * @param string $dsn |
|
23 | + */ |
|
21 | 24 | public static function connect($dsn, $username=null, $password=null, $options=[]){ |
22 | 25 | static::$connection = [ |
23 | 26 | 'dsn' => $dsn, |
@@ -58,6 +61,9 @@ discard block |
||
58 | 61 | return isset(static::$queries[$query]) ? static::$queries[$query] : (static::$queries[$query] = static::connection()->prepare($query)); |
59 | 62 | } |
60 | 63 | |
64 | + /** |
|
65 | + * @return boolean |
|
66 | + */ |
|
61 | 67 | public static function exec($query, $params=[]){ |
62 | 68 | if(!static::connection()) return false; |
63 | 69 | |
@@ -139,6 +145,11 @@ discard block |
||
139 | 145 | return static::each($query,$params,$looper); |
140 | 146 | } |
141 | 147 | |
148 | + /** |
|
149 | + * @param string $table |
|
150 | + * |
|
151 | + * @return boolean |
|
152 | + */ |
|
142 | 153 | public static function delete($table, $pks=null, $pk='id', $inclusive=true){ |
143 | 154 | if(!static::connection()) return false; |
144 | 155 | |
@@ -179,6 +190,9 @@ discard block |
||
179 | 190 | return static::updateWhere($table, $data, "`$pk`=:$pk $extra_where"); |
180 | 191 | } |
181 | 192 | |
193 | + /** |
|
194 | + * @return boolean |
|
195 | + */ |
|
182 | 196 | public static function insertOrUpdate($table, $data=[], $pk='id', $extra_where=''){ |
183 | 197 | if(!static::connection()) return false; |
184 | 198 |
@@ -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; |
@@ -77,6 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | /** |
79 | 79 | * Check if a template exists |
80 | + * @param string $templatePath |
|
80 | 81 | * @return bool |
81 | 82 | */ |
82 | 83 | public static function exists($templatePath){ |
@@ -19,6 +19,9 @@ discard block |
||
19 | 19 | protected static $templatePath, |
20 | 20 | $globals = []; |
21 | 21 | |
22 | + /** |
|
23 | + * @param string $path |
|
24 | + */ |
|
22 | 25 | public function __construct($path=null,$options=[]){ |
23 | 26 | self::$templatePath = ($path ? rtrim($path,'/') : __DIR__) . '/'; |
24 | 27 | } |
@@ -57,6 +60,9 @@ discard block |
||
57 | 60 | class PHPContext { |
58 | 61 | protected $data = []; |
59 | 62 | |
63 | + /** |
|
64 | + * @param string $path |
|
65 | + */ |
|
60 | 66 | public function __construct($data=[], $path=null){ |
61 | 67 | $this->data = $data; |
62 | 68 | } |
@@ -2,6 +2,10 @@ |
||
2 | 2 | |
3 | 3 | class RouteTest extends PHPUnit_Framework_TestCase { |
4 | 4 | |
5 | + /** |
|
6 | + * @param string $uri |
|
7 | + * @param string $method |
|
8 | + */ |
|
5 | 9 | private function mock_request($uri, $method){ |
6 | 10 | Filter::remove('core.request.method'); |
7 | 11 | Filter::remove('core.request.URI'); |