@@ -28,8 +28,8 @@ discard block |
||
| 28 | 28 | class TDMCreatePhpCode |
| 29 | 29 | { |
| 30 | 30 | /** |
| 31 | - * @static function getInstance |
|
| 32 | - * @param null |
|
| 31 | + * @static function getInstance |
|
| 32 | + * @param null |
|
| 33 | 33 | * @return TDMCreatePhpCode |
| 34 | 34 | */ |
| 35 | 35 | public static function getInstance() |
@@ -81,36 +81,36 @@ discard block |
||
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /** |
| 84 | - * @public function getPhpCodeDefine |
|
| 85 | - * @param $left |
|
| 86 | - * @param $right |
|
| 87 | - * |
|
| 88 | - * @return string |
|
| 89 | - */ |
|
| 84 | + * @public function getPhpCodeDefine |
|
| 85 | + * @param $left |
|
| 86 | + * @param $right |
|
| 87 | + * |
|
| 88 | + * @return string |
|
| 89 | + */ |
|
| 90 | 90 | public function getPhpCodeDefine($left, $right) |
| 91 | 91 | { |
| 92 | 92 | return "define('{$left}', {$right});\n"; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
| 96 | - * @public function getPhpCodeDefine |
|
| 97 | - * @param $left |
|
| 98 | - * @param $right |
|
| 99 | - * |
|
| 100 | - * @return string |
|
| 101 | - */ |
|
| 96 | + * @public function getPhpCodeDefine |
|
| 97 | + * @param $left |
|
| 98 | + * @param $right |
|
| 99 | + * |
|
| 100 | + * @return string |
|
| 101 | + */ |
|
| 102 | 102 | public function getPhpCodeDefined($left = 'XOOPS_ROOT_PATH', $right = 'Restricted access') |
| 103 | 103 | { |
| 104 | 104 | return "defined('{$left}') || die('{$right}');\n"; |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
| 108 | - * @public function getPhpCodeGlobals |
|
| 109 | - * @param $var |
|
| 110 | - * @param $value |
|
| 111 | - * |
|
| 112 | - * @return string |
|
| 113 | - */ |
|
| 108 | + * @public function getPhpCodeGlobals |
|
| 109 | + * @param $var |
|
| 110 | + * @param $value |
|
| 111 | + * |
|
| 112 | + * @return string |
|
| 113 | + */ |
|
| 114 | 114 | public function getPhpCodeGlobals($var, $value = '') |
| 115 | 115 | { |
| 116 | 116 | if ('' != $value) { |
@@ -123,12 +123,12 @@ discard block |
||
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | /** |
| 126 | - * @public function getPhpCodeGlobalsVariables |
|
| 127 | - * @param $var |
|
| 128 | - * @param $type |
|
| 129 | - * |
|
| 130 | - * @return string |
|
| 131 | - */ |
|
| 126 | + * @public function getPhpCodeGlobalsVariables |
|
| 127 | + * @param $var |
|
| 128 | + * @param $type |
|
| 129 | + * |
|
| 130 | + * @return string |
|
| 131 | + */ |
|
| 132 | 132 | public function getPhpCodeGlobalsVariables($var = null, $type = 'REQUEST') |
| 133 | 133 | { |
| 134 | 134 | $type = strtoupper($type); |
@@ -173,11 +173,11 @@ discard block |
||
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | /** |
| 176 | - * @public function getPhpCodeFileExists |
|
| 177 | - * @param $filename |
|
| 178 | - * |
|
| 179 | - * @return string |
|
| 180 | - */ |
|
| 176 | + * @public function getPhpCodeFileExists |
|
| 177 | + * @param $filename |
|
| 178 | + * |
|
| 179 | + * @return string |
|
| 180 | + */ |
|
| 181 | 181 | public function getPhpCodeFileExists($filename) |
| 182 | 182 | { |
| 183 | 183 | return "file_exists({$filename})"; |
@@ -217,29 +217,29 @@ discard block |
||
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | /** |
| 220 | - * @public function getPhpCodeTernaryOperator |
|
| 221 | - * @param $return |
|
| 222 | - * @param $condition |
|
| 223 | - * @param $one |
|
| 224 | - * @param $two |
|
| 225 | - * @param $t - Indentation |
|
| 226 | - * |
|
| 227 | - * @return string |
|
| 228 | - */ |
|
| 220 | + * @public function getPhpCodeTernaryOperator |
|
| 221 | + * @param $return |
|
| 222 | + * @param $condition |
|
| 223 | + * @param $one |
|
| 224 | + * @param $two |
|
| 225 | + * @param $t - Indentation |
|
| 226 | + * |
|
| 227 | + * @return string |
|
| 228 | + */ |
|
| 229 | 229 | public function getPhpCodeTernaryOperator($return, $condition, $one, $two, $t = '') |
| 230 | 230 | { |
| 231 | 231 | return "{$t}\${$return} = {$condition} ? {$one} : {$two};\n"; |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | /** |
| 235 | - * @public function getPhpCodeClass |
|
| 236 | - * @param $name |
|
| 237 | - * @param $content |
|
| 238 | - * @param $extends |
|
| 239 | - * @param $type |
|
| 240 | - * |
|
| 241 | - * @return string |
|
| 242 | - */ |
|
| 235 | + * @public function getPhpCodeClass |
|
| 236 | + * @param $name |
|
| 237 | + * @param $content |
|
| 238 | + * @param $extends |
|
| 239 | + * @param $type |
|
| 240 | + * |
|
| 241 | + * @return string |
|
| 242 | + */ |
|
| 243 | 243 | public function getPhpCodeClass($name = null, $content = null, $extends = null, $type = null) |
| 244 | 244 | { |
| 245 | 245 | $typ = (null != $type) ? "{$type} " : ''; |
@@ -253,14 +253,14 @@ discard block |
||
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | /** |
| 256 | - * @public function getPhpCodeClass |
|
| 257 | - * @param $type |
|
| 258 | - * @param $name |
|
| 259 | - * @param $assign |
|
| 260 | - * @param $t - Indentation |
|
| 261 | - * |
|
| 262 | - * @return string |
|
| 263 | - */ |
|
| 256 | + * @public function getPhpCodeClass |
|
| 257 | + * @param $type |
|
| 258 | + * @param $name |
|
| 259 | + * @param $assign |
|
| 260 | + * @param $t - Indentation |
|
| 261 | + * |
|
| 262 | + * @return string |
|
| 263 | + */ |
|
| 264 | 264 | public function getPhpCodeVariableClass($type = 'private', $name = null, $assign = 'null', $t = '') |
| 265 | 265 | { |
| 266 | 266 | return "{$t}{$type} \${$name} = {$assign};\n"; |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | public function getPhpCodeSwitch($op = null, $content = null, $t = '') |
| 398 | 398 | { |
| 399 | 399 | //$ret = "{$t}switch(\${$op}) {\n"; test goffy |
| 400 | - $ret = "switch(\${$op}) {\n"; |
|
| 400 | + $ret = "switch(\${$op}) {\n"; |
|
| 401 | 401 | $ret .= "{$content}"; |
| 402 | 402 | $ret .= "}\n"; |
| 403 | 403 | |
@@ -444,10 +444,10 @@ discard block |
||
| 444 | 444 | } |
| 445 | 445 | |
| 446 | 446 | /** |
| 447 | - * @public function getPhpCodeIsset |
|
| 448 | - * @param $var |
|
| 449 | - * @return string |
|
| 450 | - */ |
|
| 447 | + * @public function getPhpCodeIsset |
|
| 448 | + * @param $var |
|
| 449 | + * @return string |
|
| 450 | + */ |
|
| 451 | 451 | public function getPhpCodeIsset($var) |
| 452 | 452 | { |
| 453 | 453 | return "isset(\${$var})"; |
@@ -465,32 +465,32 @@ discard block |
||
| 465 | 465 | } |
| 466 | 466 | |
| 467 | 467 | /** |
| 468 | - * @public function getPhpCodeIsDir |
|
| 469 | - * @param $var |
|
| 470 | - * @return string |
|
| 471 | - */ |
|
| 468 | + * @public function getPhpCodeIsDir |
|
| 469 | + * @param $var |
|
| 470 | + * @return string |
|
| 471 | + */ |
|
| 472 | 472 | public function getPhpCodeIsDir($var) |
| 473 | 473 | { |
| 474 | 474 | return "is_dir({$var})"; |
| 475 | 475 | } |
| 476 | 476 | |
| 477 | 477 | /** |
| 478 | - * @public function getPhpCodeImplode |
|
| 479 | - * @param $left |
|
| 480 | - * @param $right |
|
| 481 | - * @return string |
|
| 482 | - */ |
|
| 478 | + * @public function getPhpCodeImplode |
|
| 479 | + * @param $left |
|
| 480 | + * @param $right |
|
| 481 | + * @return string |
|
| 482 | + */ |
|
| 483 | 483 | public function getPhpCodeImplode($left, $right) |
| 484 | 484 | { |
| 485 | 485 | return "implode('{$left}', {$right})"; |
| 486 | 486 | } |
| 487 | 487 | |
| 488 | 488 | /** |
| 489 | - * @public function getPhpCodeExplode |
|
| 490 | - * @param $left |
|
| 491 | - * @param $right |
|
| 492 | - * @return string |
|
| 493 | - */ |
|
| 489 | + * @public function getPhpCodeExplode |
|
| 490 | + * @param $left |
|
| 491 | + * @param $right |
|
| 492 | + * @return string |
|
| 493 | + */ |
|
| 494 | 494 | public function getPhpCodeExplode($left, $right) |
| 495 | 495 | { |
| 496 | 496 | return "explode('{$left}', {$right})"; |
@@ -591,41 +591,41 @@ discard block |
||
| 591 | 591 | } |
| 592 | 592 | |
| 593 | 593 | /** |
| 594 | - * @public function getPhpCodeSprintf |
|
| 595 | - * @param $left |
|
| 596 | - * @param $right |
|
| 597 | - * @return string |
|
| 598 | - */ |
|
| 594 | + * @public function getPhpCodeSprintf |
|
| 595 | + * @param $left |
|
| 596 | + * @param $right |
|
| 597 | + * @return string |
|
| 598 | + */ |
|
| 599 | 599 | public function getPhpCodeSprintf($left, $right) |
| 600 | 600 | { |
| 601 | 601 | return "sprintf({$left}, {$right})"; |
| 602 | 602 | } |
| 603 | 603 | |
| 604 | 604 | /** |
| 605 | - * @public function getPhpCodeEmpty |
|
| 606 | - * @param $var |
|
| 607 | - * @return string |
|
| 608 | - */ |
|
| 605 | + * @public function getPhpCodeEmpty |
|
| 606 | + * @param $var |
|
| 607 | + * @return string |
|
| 608 | + */ |
|
| 609 | 609 | public function getPhpCodeEmpty($var) |
| 610 | 610 | { |
| 611 | 611 | return "empty({$var})"; |
| 612 | 612 | } |
| 613 | 613 | |
| 614 | 614 | /** |
| 615 | - * @public function getPhpCodeHeader |
|
| 616 | - * @param $var |
|
| 617 | - * @return string |
|
| 618 | - */ |
|
| 615 | + * @public function getPhpCodeHeader |
|
| 616 | + * @param $var |
|
| 617 | + * @return string |
|
| 618 | + */ |
|
| 619 | 619 | public function getPhpCodeHeader($var) |
| 620 | 620 | { |
| 621 | 621 | return "header({$var})"; |
| 622 | 622 | } |
| 623 | 623 | |
| 624 | 624 | /** |
| 625 | - * @public function getPhpCodeRawurlencode |
|
| 626 | - * @param $var |
|
| 627 | - * @return string |
|
| 628 | - */ |
|
| 625 | + * @public function getPhpCodeRawurlencode |
|
| 626 | + * @param $var |
|
| 627 | + * @return string |
|
| 628 | + */ |
|
| 629 | 629 | public function getPhpCodeRawurlencode($var) |
| 630 | 630 | { |
| 631 | 631 | return "rawurlencode({$var})"; |
@@ -700,11 +700,11 @@ discard block |
||
| 700 | 700 | } |
| 701 | 701 | |
| 702 | 702 | /** |
| 703 | - * @public function getPhpCodeHtmlentities |
|
| 704 | - * @param $entitiesVar |
|
| 705 | - * @param $entitiesQuote |
|
| 706 | - * @return string |
|
| 707 | - */ |
|
| 703 | + * @public function getPhpCodeHtmlentities |
|
| 704 | + * @param $entitiesVar |
|
| 705 | + * @param $entitiesQuote |
|
| 706 | + * @return string |
|
| 707 | + */ |
|
| 708 | 708 | public function getPhpCodeHtmlentities($entitiesVar, $entitiesQuote = false) |
| 709 | 709 | { |
| 710 | 710 | $entitiesVar = (false !== $entitiesQuote) ? $entitiesVar . ', ' . $entitiesQuote : $entitiesVar; |
@@ -714,11 +714,11 @@ discard block |
||
| 714 | 714 | } |
| 715 | 715 | |
| 716 | 716 | /** |
| 717 | - * @public function getPhpCodeHtmlspecialchars |
|
| 718 | - * @param $specialVar |
|
| 719 | - * @param $specialQuote |
|
| 720 | - * @return string |
|
| 721 | - */ |
|
| 717 | + * @public function getPhpCodeHtmlspecialchars |
|
| 718 | + * @param $specialVar |
|
| 719 | + * @param $specialQuote |
|
| 720 | + * @return string |
|
| 721 | + */ |
|
| 722 | 722 | public function getPhpCodeHtmlspecialchars($specialVar, $specialQuote = false) |
| 723 | 723 | { |
| 724 | 724 | $specialVar = (false !== $specialQuote) ? $specialVar . ', ' . $specialQuote : $specialVar; |