@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * Enabled/Disabled the cache. |
| 45 | 45 | * |
| 46 | 46 | * @param boolean $bIsEnable |
| 47 | - * @return object this |
|
| 47 | + * @return Cache this |
|
| 48 | 48 | */ |
| 49 | 49 | public function enabled($bIsEnable) |
| 50 | 50 | { |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | * If you do not use this method, a default directory will be created. |
| 60 | 60 | * |
| 61 | 61 | * @param string $sCacheDir |
| 62 | - * @return object this |
|
| 62 | + * @return Cache this |
|
| 63 | 63 | * @throws \PH7\Framework\Error\CException\PH7InvalidArgumentException An explanatory message if the directory does not exist. |
| 64 | 64 | */ |
| 65 | 65 | public function setCacheDir($sCacheDir) |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | * Sets the cache prefix. |
| 77 | 77 | * |
| 78 | 78 | * @param string $sPrefix |
| 79 | - * @return object this |
|
| 79 | + * @return Cache this |
|
| 80 | 80 | */ |
| 81 | 81 | public function setPrefix($sPrefix) |
| 82 | 82 | { |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | * Sets the time expire cache. |
| 89 | 89 | * |
| 90 | 90 | * @param integer $iExpire (the time with the 'touch' function). |
| 91 | - * @return object this |
|
| 91 | + * @return Cache this |
|
| 92 | 92 | */ |
| 93 | 93 | public function setExpire($iExpire) |
| 94 | 94 | { |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | * @param string $sGroup The Group Cache (This creates a folder). |
| 105 | 105 | * @param string $sId (The ID for the file). |
| 106 | 106 | * @param integer $iTtl Cache lifetime in seconds. If NULL, the file never expires. |
| 107 | - * @return object this |
|
| 107 | + * @return Cache this |
|
| 108 | 108 | */ |
| 109 | 109 | public function start($sGroup, $sId, $iTtl) |
| 110 | 110 | { |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | * Puts the data in the cache. |
| 163 | 163 | * |
| 164 | 164 | * @param string $sData |
| 165 | - * @return string (object | null) If the cache is disabled, returns null otherwise returns a this object. |
|
| 165 | + * @return null|Cache (object | null) If the cache is disabled, returns null otherwise returns a this object. |
|
| 166 | 166 | */ |
| 167 | 167 | public function put($sData) |
| 168 | 168 | { |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | /** |
| 177 | 177 | * Clear the cache. |
| 178 | 178 | * |
| 179 | - * @return object this |
|
| 179 | + * @return Cache this |
|
| 180 | 180 | */ |
| 181 | 181 | public function clear() |
| 182 | 182 | { |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | * |
| 264 | 264 | * @access private |
| 265 | 265 | * @param boolean $bPrint |
| 266 | - * @return mixed (boolean | string) Returns TRUE or a string if successful, FALSE otherwise. |
|
| 266 | + * @return string (boolean | string) Returns TRUE or a string if successful, FALSE otherwise. |
|
| 267 | 267 | */ |
| 268 | 268 | private function _read($bPrint) |
| 269 | 269 | { |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | * |
| 325 | 325 | * If the folder cache does not exist, it creates a folder. |
| 326 | 326 | * @access private |
| 327 | - * @return object this |
|
| 327 | + * @return Cache this |
|
| 328 | 328 | */ |
| 329 | 329 | private function _checkCacheDir() |
| 330 | 330 | { |
@@ -68,6 +68,9 @@ |
||
| 68 | 68 | $this->_bIsGoogleClosure = (bool) Config::getInstance()->values['cache']['enable.js.closure_compiler_service']; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | + /** |
|
| 72 | + * @param string $sPhp |
|
| 73 | + */ |
|
| 71 | 74 | public function parsePhp($sPhp) |
| 72 | 75 | { |
| 73 | 76 | $sPhp = preg_replace('#/\*.*+\*#', '', $sPhp); # Removing PHP comments |
@@ -120,6 +120,7 @@ discard block |
||
| 120 | 120 | * Check if file exists. |
| 121 | 121 | * |
| 122 | 122 | * @param mixed (array | string) $mFile |
| 123 | + * @param string $mFile |
|
| 123 | 124 | * @return boolean TRUE if file exists, FALSE otherwise. |
| 124 | 125 | */ |
| 125 | 126 | public function existFile($mFile) |
@@ -273,6 +274,7 @@ discard block |
||
| 273 | 274 | * |
| 274 | 275 | * @param mixed (string | array) $mDir |
| 275 | 276 | * @param integer (octal) $iMode Default: 0777 |
| 277 | + * @param string $mDir |
|
| 276 | 278 | * @return void |
| 277 | 279 | * @throws \PH7\Framework\File\Exception If the file cannot be created. |
| 278 | 280 | */ |
@@ -321,7 +323,7 @@ discard block |
||
| 321 | 323 | * |
| 322 | 324 | * @param string $sFrom File or directory. |
| 323 | 325 | * @param string $sTo File or directory. |
| 324 | - * @return mixed (integer | boolean) Returns the last line on success, and FALSE on failure. |
|
| 326 | + * @return string|false (integer | boolean) Returns the last line on success, and FALSE on failure. |
|
| 325 | 327 | */ |
| 326 | 328 | public function systemCopy($sFrom, $sTo) |
| 327 | 329 | { |
@@ -363,7 +365,7 @@ discard block |
||
| 363 | 365 | * |
| 364 | 366 | * @param string $sFrom File or directory. |
| 365 | 367 | * @param string $sTo File or directory. |
| 366 | - * @return mixed (integer | boolean) Returns the last line on success, and FALSE on failure. |
|
| 368 | + * @return string|false (integer | boolean) Returns the last line on success, and FALSE on failure. |
|
| 367 | 369 | */ |
| 368 | 370 | public function systemRename($sFrom, $sTo) |
| 369 | 371 | { |
@@ -417,6 +419,7 @@ discard block |
||
| 417 | 419 | * Get the creation/modification time of a file in the Unix timestamp. |
| 418 | 420 | * |
| 419 | 421 | * @param string Full path of the file. |
| 422 | + * @param string $sFile |
|
| 420 | 423 | * @return mixed (integer | boolean) Returns the time the file was last modified, or FALSE if it not found. |
| 421 | 424 | */ |
| 422 | 425 | public function getModifTime($sFile) |
@@ -430,6 +433,7 @@ discard block |
||
| 430 | 433 | * |
| 431 | 434 | * @static |
| 432 | 435 | * @param string Full path of the file. |
| 436 | + * @param string $sFile |
|
| 433 | 437 | * @return integer Returns the latest modification time of the file in Unix timestamp. |
| 434 | 438 | */ |
| 435 | 439 | public static function version($sFile) |
@@ -441,7 +445,7 @@ discard block |
||
| 441 | 445 | * Delay script execution. |
| 442 | 446 | * |
| 443 | 447 | * @param integer $iSleep Halt time in seconds. Optional parameter, default value is 5. |
| 444 | - * @return mixed (integer | boolean) Returns "0" on success, or "false" on error. |
|
| 448 | + * @return integer (integer | boolean) Returns "0" on success, or "false" on error. |
|
| 445 | 449 | */ |
| 446 | 450 | public function sleep($iSleep = null) |
| 447 | 451 | { |
@@ -681,7 +685,7 @@ discard block |
||
| 681 | 685 | * Get the URL contents (For URLs, it is better to use CURL because it is faster than file_get_contents function). |
| 682 | 686 | * |
| 683 | 687 | * @param string $sUrl URL to be read contents. |
| 684 | - * @return mixed (string | boolean) Return the result content on success, FALSE on failure. |
|
| 688 | + * @return string (string | boolean) Return the result content on success, FALSE on failure. |
|
| 685 | 689 | */ |
| 686 | 690 | public function getUrlContents($sUrl) |
| 687 | 691 | { |
@@ -754,7 +758,7 @@ discard block |
||
| 754 | 758 | * Create a recurive directory iterator for a given directory. |
| 755 | 759 | * |
| 756 | 760 | * @param string $sPath |
| 757 | - * @return string The directory. |
|
| 761 | + * @return \RecursiveDirectoryIterator The directory. |
|
| 758 | 762 | */ |
| 759 | 763 | public function getDirIterator($sPath) |
| 760 | 764 | { |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | /** |
| 220 | - * @return mixed |
|
| 220 | + * @return boolean |
|
| 221 | 221 | */ |
| 222 | 222 | public function getEnableGeolocation() |
| 223 | 223 | { |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | * |
| 446 | 446 | * @param string $address an address |
| 447 | 447 | * |
| 448 | - * @return array array with precision, lat & lng |
|
| 448 | + * @return string array with precision, lat & lng |
|
| 449 | 449 | */ |
| 450 | 450 | public function geocoding($address) |
| 451 | 451 | { |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | /** |
| 92 | 92 | * @static |
| 93 | 93 | * @param integer $iStatus The "code" for the HTTP status |
| 94 | - * @return mixed (string | boolean) $iStatus Returns the "HTTP status code" if found otherwise returns "false" |
|
| 94 | + * @return integer (string | boolean) $iStatus Returns the "HTTP status code" if found otherwise returns "false" |
|
| 95 | 95 | */ |
| 96 | 96 | public static function getStatusCodes($iStatus) |
| 97 | 97 | { |
@@ -129,6 +129,7 @@ discard block |
||
| 129 | 129 | * |
| 130 | 130 | * @static |
| 131 | 131 | * @param mixed (string | array) $mHeaders Headers to send. |
| 132 | + * @param string $mHeaders |
|
| 132 | 133 | * @throws \PH7\Framework\Http\Exception |
| 133 | 134 | */ |
| 134 | 135 | public static function setHeaders($mHeaders) |
@@ -188,7 +189,7 @@ discard block |
||
| 188 | 189 | * @static |
| 189 | 190 | * @param string $sUsr |
| 190 | 191 | * @param string $sPwd |
| 191 | - * @return boolean TRUE if the authentication is correct, otherwise FALSE. |
|
| 192 | + * @return null|boolean TRUE if the authentication is correct, otherwise FALSE. |
|
| 192 | 193 | */ |
| 193 | 194 | public static function requireAuth($sUsr, $sPwd) |
| 194 | 195 | { |
@@ -283,6 +283,10 @@ discard block |
||
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | /*This method restores the serialized form instance.*/ |
| 286 | + |
|
| 287 | + /** |
|
| 288 | + * @param string $id |
|
| 289 | + */ |
|
| 286 | 290 | private static function recover($id) |
| 287 | 291 | { |
| 288 | 292 | if(!empty($_SESSION['pfbc'][$id]['form'])) |
@@ -483,6 +487,10 @@ discard block |
||
| 483 | 487 | |
| 484 | 488 | /*Valldation errors are saved in the session after the form submission, and will be displayed to the user |
| 485 | 489 | when redirected back to the form.*/ |
| 490 | + |
|
| 491 | + /** |
|
| 492 | + * @param string $id |
|
| 493 | + */ |
|
| 486 | 494 | public static function setError($id, $messages, $element = '') |
| 487 | 495 | { |
| 488 | 496 | if (!is_array($messages)) |
@@ -496,11 +504,18 @@ discard block |
||
| 496 | 504 | } |
| 497 | 505 | |
| 498 | 506 | /*setSuccess*/ |
| 507 | + |
|
| 508 | + /** |
|
| 509 | + * @param string $id |
|
| 510 | + */ |
|
| 499 | 511 | public static function setSuccess($id, $message, $element = '') |
| 500 | 512 | { |
| 501 | 513 | return (new Design)->setFlashMsg($message, Design::SUCCESS_TYPE); |
| 502 | 514 | } |
| 503 | 515 | |
| 516 | + /** |
|
| 517 | + * @param string $id |
|
| 518 | + */ |
|
| 504 | 519 | public static function setSessionValue($id, $element, $value) |
| 505 | 520 | { |
| 506 | 521 | $_SESSION['pfbc'][$id]['values'][$element] = $value; |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | * @see get() |
| 36 | 36 | * |
| 37 | 37 | * @param boolean $bPrint Default FALSE |
| 38 | - * @return void |
|
| 38 | + * @return null|string |
|
| 39 | 39 | */ |
| 40 | 40 | public function display($bPrint = false) |
| 41 | 41 | { |
@@ -108,6 +108,7 @@ discard block |
||
| 108 | 108 | * |
| 109 | 109 | * @param mixed (array or string) $mKey The key of the request or an array with the list of key of the variables request. |
| 110 | 110 | * @param string $sParam Optional parameter, check the type of the request variable | Value type is: str, int, float, bool |
| 111 | + * @param string $mKey |
|
| 111 | 112 | * @return boolean |
| 112 | 113 | */ |
| 113 | 114 | public function postExists($mKey, $sParam = null) |
@@ -280,6 +281,7 @@ discard block |
||
| 280 | 281 | } |
| 281 | 282 | |
| 282 | 283 | /** |
| 284 | + * @param string $sUrl |
|
| 283 | 285 | * @return string The correct pH7's URL. |
| 284 | 286 | */ |
| 285 | 287 | public function pH7Url($sUrl) |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | * Count the length of a string and supports the special characters (Asian, Latin, ...). |
| 78 | 78 | * |
| 79 | 79 | * @param string $sText |
| 80 | - * @return string |
|
| 80 | + * @return integer |
|
| 81 | 81 | */ |
| 82 | 82 | public function length($sText) |
| 83 | 83 | { |
@@ -115,8 +115,8 @@ discard block |
||
| 115 | 115 | * Test the equality of two strings. |
| 116 | 116 | * |
| 117 | 117 | * @personal For the PHP AND C functions, strcmp and strcasecmp returns a positive or negative integer value if they are different and 0 if they are equal. |
| 118 | - * @param string $text1 |
|
| 119 | - * @param string $text2 |
|
| 118 | + * @param string $sText1 |
|
| 119 | + * @param string $sText2 |
|
| 120 | 120 | * @return boolean |
| 121 | 121 | */ |
| 122 | 122 | public function equals($sText1, $sText2) |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | * @access protected |
| 299 | 299 | * @param string $sText |
| 300 | 300 | * @param boolean $bStrip |
| 301 | - * @return The text parsed with Str::stripTags() method if $bStrip parameter is TRUE, otherwise with Str::htmlSpecialChars method. |
|
| 301 | + * @return string text parsed with Str::stripTags() method if $bStrip parameter is TRUE, otherwise with Str::htmlSpecialChars method. |
|
| 302 | 302 | */ |
| 303 | 303 | protected function cEscape($sText, $bStrip) |
| 304 | 304 | { |
@@ -325,6 +325,9 @@ discard block |
||
| 325 | 325 | return htmlspecialchars($sText, ENT_QUOTES, 'utf-8'); |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | + /** |
|
| 329 | + * @param string $sPattern |
|
| 330 | + */ |
|
| 328 | 331 | private static function _regexNormalize($sPattern) |
| 329 | 332 | { |
| 330 | 333 | return self::$_sRegexDelimiter . trim($sPattern, self::$_sRegexDelimiter) . self::$_sRegexDelimiter; |