@@ -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'); |
@@ -57,6 +57,9 @@ discard block |
||
| 57 | 57 | fwrite($this->socket, $payload); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | + /** |
|
| 61 | + * @param integer $code |
|
| 62 | + */ |
|
| 60 | 63 | protected function expectCode($code){ |
| 61 | 64 | |
| 62 | 65 | $this->lastMessage = ''; |
@@ -98,6 +101,9 @@ discard block |
||
| 98 | 101 | $this->attachments[] = $file; |
| 99 | 102 | } |
| 100 | 103 | |
| 104 | + /** |
|
| 105 | + * @param string $body |
|
| 106 | + */ |
|
| 101 | 107 | protected function SMTPmail($to,$subject,$body,$heads=''){ |
| 102 | 108 | $this->connect(); |
| 103 | 109 | $this->expectCode(220); |