@@ -59,6 +59,10 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | |
| 61 | 61 | // https://code.spip.net/@argumenter_inclure |
| 62 | +/** |
|
| 63 | + * @param boolean $rejet_filtres |
|
| 64 | + * @param string $id_boucle |
|
| 65 | + */ |
|
| 62 | 66 | function argumenter_inclure( |
| 63 | 67 | $params, |
| 64 | 68 | $rejet_filtres, |
@@ -751,7 +755,7 @@ discard block |
||
| 751 | 755 | * Nom de la commande |
| 752 | 756 | * @param string $val |
| 753 | 757 | * Code PHP décrivant la valeur à affecter |
| 754 | - * @return array |
|
| 758 | + * @return string[] |
|
| 755 | 759 | * |
| 756 | 760 | * - index 0 : Code pour une affectation statique. Si non rempli, la propriété devra |
| 757 | 761 | * être ré-affectée à chaque appel de la boucle. |
@@ -859,6 +863,9 @@ discard block |
||
| 859 | 863 | } |
| 860 | 864 | |
| 861 | 865 | // https://code.spip.net/@calculer_order |
| 866 | +/** |
|
| 867 | + * @param Boucle $boucle |
|
| 868 | + */ |
|
| 862 | 869 | function calculer_order(&$boucle) { |
| 863 | 870 | if (!$order = $boucle->order |
| 864 | 871 | and !$order = $boucle->default_order |
@@ -944,6 +951,9 @@ discard block |
||
| 944 | 951 | define('_REGEXP_CONCAT_NON_VIDE', "/^(.*)[.]\s*'[^']+'\s*$/"); |
| 945 | 952 | |
| 946 | 953 | // https://code.spip.net/@compile_cas |
| 954 | +/** |
|
| 955 | + * @param string $id_boucle |
|
| 956 | + */ |
|
| 947 | 957 | function compile_cas($tableau, $descr, &$boucles, $id_boucle) { |
| 948 | 958 | |
| 949 | 959 | $codes = array(); |
@@ -654,6 +654,11 @@ discard block |
||
| 654 | 654 | } |
| 655 | 655 | |
| 656 | 656 | // https://code.spip.net/@calculer_critere_arg_dynamique |
| 657 | +/** |
|
| 658 | + * @param string $idb |
|
| 659 | + * |
|
| 660 | + * @return string |
|
| 661 | + */ |
|
| 657 | 662 | function calculer_critere_arg_dynamique($idb, &$boucles, $crit, $suffix = '') { |
| 658 | 663 | $boucle = $boucles[$idb]; |
| 659 | 664 | $alt = "('" . $boucle->id_table . '.\' . $x' . $suffix . ')'; |
@@ -1503,6 +1508,10 @@ discard block |
||
| 1503 | 1508 | } |
| 1504 | 1509 | |
| 1505 | 1510 | // https://code.spip.net/@critere_IN_cas |
| 1511 | +/** |
|
| 1512 | + * @param string $idb |
|
| 1513 | + * @param string $crit2 |
|
| 1514 | + */ |
|
| 1506 | 1515 | function critere_IN_cas($idb, &$boucles, $crit2, $arg, $op, $val, $col) { |
| 1507 | 1516 | static $num = array(); |
| 1508 | 1517 | $descr = $boucles[$idb]->descr; |
@@ -432,6 +432,10 @@ discard block |
||
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | // https://code.spip.net/@reference_boucle_debug |
| 435 | +/** |
|
| 436 | + * @param string $nom |
|
| 437 | + * @param string $self |
|
| 438 | + */ |
|
| 435 | 439 | function reference_boucle_debug($n, $nom, $self) { |
| 436 | 440 | list($skel, $boucle, $ligne) = trouve_boucle_debug($n, $nom); |
| 437 | 441 | |
@@ -820,6 +824,9 @@ discard block |
||
| 820 | 824 | } |
| 821 | 825 | |
| 822 | 826 | // https://code.spip.net/@debusquer_entete |
| 827 | +/** |
|
| 828 | + * @param string $corps |
|
| 829 | + */ |
|
| 823 | 830 | function debusquer_entete($titre, $corps) { |
| 824 | 831 | |
| 825 | 832 | include_spip('balise/formulaire_admin'); |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | * est dans une autre table et construit la jointure dessus |
| 323 | 323 | * - liste (table, champ, fonction) idem, mais en passant un |
| 324 | 324 | * nom de fonction qui s'occupera de créer la jointure. |
| 325 | - * @return array |
|
| 325 | + * @return string[] |
|
| 326 | 326 | * Liste (nom du champ alias, nom du champ). Le nom du champ alias |
| 327 | 327 | * est une expression pour le SELECT de la boucle du style "mots.titre AS titre_mot" |
| 328 | 328 | **/ |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | * Nom de la balise |
| 501 | 501 | * @param Champ $p |
| 502 | 502 | * AST au niveau de la balise |
| 503 | - * @return string |
|
| 503 | + * @return Champ |
|
| 504 | 504 | * Code PHP pour d'exécution de la balise et de ses filtres |
| 505 | 505 | **/ |
| 506 | 506 | function calculer_balise_DEFAUT_dist($nom, $p) { |
@@ -784,6 +784,9 @@ discard block |
||
| 784 | 784 | // - deux etoiles => pas de securite non plus ! |
| 785 | 785 | // |
| 786 | 786 | // https://code.spip.net/@applique_filtres |
| 787 | +/** |
|
| 788 | + * @param Champ $p |
|
| 789 | + */ |
|
| 787 | 790 | function applique_filtres($p) { |
| 788 | 791 | |
| 789 | 792 | // Traitements standards (cf. supra) |
@@ -858,6 +861,9 @@ discard block |
||
| 858 | 861 | |
| 859 | 862 | // Filtres et,ou,oui,non,sinon,xou,xor,and,or,not,yes |
| 860 | 863 | // et comparateurs |
| 864 | +/** |
|
| 865 | + * @param string $arg |
|
| 866 | + */ |
|
| 861 | 867 | function filtre_logique($fonc, $code, $arg) { |
| 862 | 868 | |
| 863 | 869 | switch (true) { |
@@ -881,6 +887,9 @@ discard block |
||
| 881 | 887 | } |
| 882 | 888 | |
| 883 | 889 | // https://code.spip.net/@compose_filtres_args |
| 890 | +/** |
|
| 891 | + * @param string $sep |
|
| 892 | + */ |
|
| 884 | 893 | function compose_filtres_args($p, $args, $sep) { |
| 885 | 894 | $arglist = ""; |
| 886 | 895 | foreach ($args as $arg) { |
@@ -928,6 +937,11 @@ discard block |
||
| 928 | 937 | // |
| 929 | 938 | |
| 930 | 939 | // https://code.spip.net/@rindex_pile |
| 940 | +/** |
|
| 941 | + * @param Champ $p |
|
| 942 | + * @param string $champ |
|
| 943 | + * @param string $motif |
|
| 944 | + */ |
|
| 931 | 945 | function rindex_pile($p, $champ, $motif) { |
| 932 | 946 | $n = 0; |
| 933 | 947 | $b = $p->id_boucle; |
@@ -957,7 +971,7 @@ discard block |
||
| 957 | 971 | |
| 958 | 972 | /** |
| 959 | 973 | * Retourne le nom de la balise indiquée pour les messages d’erreurs |
| 960 | - * @param Pile $p Description de la balise |
|
| 974 | + * @param Champ $p Description de la balise |
|
| 961 | 975 | * @param string $champ Nom du champ |
| 962 | 976 | * @return string Nom de la balise, avec indication de boucle explicite si présent. |
| 963 | 977 | */ |
@@ -132,6 +132,11 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | // Par ou ca passe une fois les traductions faites |
| 134 | 134 | // https://code.spip.net/@spip_pg_trace_query |
| 135 | +/** |
|
| 136 | + * @param string $query |
|
| 137 | + * |
|
| 138 | + * @return resource |
|
| 139 | + */ |
|
| 135 | 140 | function spip_pg_trace_query($query, $serveur = '') { |
| 136 | 141 | $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0]; |
| 137 | 142 | $prefixe = $connexion['prefixe']; |
@@ -291,6 +296,9 @@ discard block |
||
| 291 | 296 | } |
| 292 | 297 | |
| 293 | 298 | // https://code.spip.net/@spip_pg_alter_change |
| 299 | +/** |
|
| 300 | + * @param string $arg |
|
| 301 | + */ |
|
| 294 | 302 | function spip_pg_alter_change($table, $arg, $serveur = '', $requeter = true) { |
| 295 | 303 | if (!preg_match('/^`?(\w+)`?\s+`?(\w+)`?\s+(.*?)\s*(DEFAULT .*?)?(NOT\s+NULL)?\s*(DEFAULT .*?)?$/i', $arg, $r)) { |
| 296 | 304 | spip_log("alter change: $arg incompris", 'pg.' . _LOG_ERREUR); |
@@ -417,6 +425,7 @@ discard block |
||
| 417 | 425 | * @param string /array $champs : liste de champs sur lesquels s'applique l'index |
| 418 | 426 | * @param string $serveur : nom de la connexion sql utilisee |
| 419 | 427 | * @param bool $requeter : true pour executer la requete ou false pour retourner le texte de la requete |
| 428 | + * @param string $champs |
|
| 420 | 429 | * |
| 421 | 430 | * @return bool ou requete |
| 422 | 431 | */ |
@@ -592,6 +601,9 @@ discard block |
||
| 592 | 601 | } |
| 593 | 602 | |
| 594 | 603 | // https://code.spip.net/@spip_pg_orderby |
| 604 | +/** |
|
| 605 | + * @param string $order |
|
| 606 | + */ |
|
| 595 | 607 | function spip_pg_orderby($order, $select) { |
| 596 | 608 | $res = array(); |
| 597 | 609 | $arg = (is_array($order) ? $order : preg_split('/\s*,\s*/', $order)); |
@@ -766,6 +778,9 @@ discard block |
||
| 766 | 778 | } |
| 767 | 779 | |
| 768 | 780 | // https://code.spip.net/@calculer_pg_where |
| 781 | +/** |
|
| 782 | + * @param string $v |
|
| 783 | + */ |
|
| 769 | 784 | function calculer_pg_where($v) { |
| 770 | 785 | if (!is_array($v)) { |
| 771 | 786 | return spip_pg_frommysql($v); |
@@ -791,6 +806,9 @@ discard block |
||
| 791 | 806 | |
| 792 | 807 | |
| 793 | 808 | // https://code.spip.net/@calculer_pg_expression |
| 809 | +/** |
|
| 810 | + * @param string $expression |
|
| 811 | + */ |
|
| 794 | 812 | function calculer_pg_expression($expression, $v, $join = 'AND') { |
| 795 | 813 | if (empty($v)) { |
| 796 | 814 | return ''; |
@@ -842,6 +860,9 @@ discard block |
||
| 842 | 860 | } |
| 843 | 861 | |
| 844 | 862 | // https://code.spip.net/@spip_pg_fetch |
| 863 | +/** |
|
| 864 | + * @param resource $res |
|
| 865 | + */ |
|
| 845 | 866 | function spip_pg_fetch($res, $t = '', $serveur = '', $requeter = true) { |
| 846 | 867 | |
| 847 | 868 | if ($res) { |
@@ -913,6 +934,10 @@ discard block |
||
| 913 | 934 | } |
| 914 | 935 | |
| 915 | 936 | // https://code.spip.net/@spip_pg_insert |
| 937 | +/** |
|
| 938 | + * @param string $champs |
|
| 939 | + * @param string $valeurs |
|
| 940 | + */ |
|
| 916 | 941 | function spip_pg_insert($table, $champs, $valeurs, $desc = array(), $serveur = '', $requeter = true) { |
| 917 | 942 | $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0]; |
| 918 | 943 | $prefixe = $connexion['prefixe']; |
@@ -1149,6 +1174,9 @@ discard block |
||
| 1149 | 1174 | // Pas extensible pour le moment, |
| 1150 | 1175 | |
| 1151 | 1176 | // https://code.spip.net/@spip_pg_sequence |
| 1177 | +/** |
|
| 1178 | + * @return string |
|
| 1179 | + */ |
|
| 1152 | 1180 | function spip_pg_sequence($table, $raw = false) { |
| 1153 | 1181 | |
| 1154 | 1182 | include_spip('base/serial'); |
@@ -1312,7 +1340,7 @@ discard block |
||
| 1312 | 1340 | * @param bool $requeter |
| 1313 | 1341 | * true pour éxecuter la requête |
| 1314 | 1342 | * false pour retourner le texte de la requête. |
| 1315 | - * @return ressource |
|
| 1343 | + * @return resource |
|
| 1316 | 1344 | * Ressource à utiliser avec sql_fetch() |
| 1317 | 1345 | **/ |
| 1318 | 1346 | function spip_pg_showbase($match, $serveur = '', $requeter = true) { |
@@ -167,6 +167,9 @@ discard block |
||
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | // https://code.spip.net/@analyser_dtd_comment |
| 170 | +/** |
|
| 171 | + * @param string $dtd |
|
| 172 | + */ |
|
| 170 | 173 | function analyser_dtd_comment($dtd, &$dtc, $grammaire) { |
| 171 | 174 | // ejecter les commentaires, surtout quand ils contiennent du code. |
| 172 | 175 | // Option /s car sur plusieurs lignes parfois |
@@ -179,6 +182,9 @@ discard block |
||
| 179 | 182 | } |
| 180 | 183 | |
| 181 | 184 | // https://code.spip.net/@analyser_dtd_pi |
| 185 | +/** |
|
| 186 | + * @param string $dtd |
|
| 187 | + */ |
|
| 182 | 188 | function analyser_dtd_pi($dtd, &$dtc, $grammaire) { |
| 183 | 189 | if (!preg_match('/^<\?.*?>\s*(.*)$/s', $dtd, $m)) { |
| 184 | 190 | return -10; |
@@ -188,6 +194,9 @@ discard block |
||
| 188 | 194 | } |
| 189 | 195 | |
| 190 | 196 | // https://code.spip.net/@analyser_dtd_lexeme |
| 197 | +/** |
|
| 198 | + * @param string $dtd |
|
| 199 | + */ |
|
| 191 | 200 | function analyser_dtd_lexeme($dtd, &$dtc, $grammaire) { |
| 192 | 201 | |
| 193 | 202 | if (!preg_match(_REGEXP_ENTITY_DEF, $dtd, $m)) { |
@@ -215,6 +224,9 @@ discard block |
||
| 215 | 224 | // ca ne depasse pas 3 ici. |
| 216 | 225 | |
| 217 | 226 | // https://code.spip.net/@analyser_dtd_data |
| 227 | +/** |
|
| 228 | + * @param string $dtd |
|
| 229 | + */ |
|
| 218 | 230 | function analyser_dtd_data($dtd, &$dtc, $grammaire) { |
| 219 | 231 | |
| 220 | 232 | if (!preg_match(_REGEXP_INCLUDE_USE, $dtd, $m)) { |
@@ -236,6 +248,9 @@ discard block |
||
| 236 | 248 | } |
| 237 | 249 | |
| 238 | 250 | // https://code.spip.net/@analyser_dtd_notation |
| 251 | +/** |
|
| 252 | + * @param string $dtd |
|
| 253 | + */ |
|
| 239 | 254 | function analyser_dtd_notation($dtd, &$dtc, $grammaire) { |
| 240 | 255 | if (!preg_match('/^<!NOTATION.*?>\s*(.*)$/s', $dtd, $m)) { |
| 241 | 256 | return -8; |
@@ -246,6 +261,9 @@ discard block |
||
| 246 | 261 | } |
| 247 | 262 | |
| 248 | 263 | // https://code.spip.net/@analyser_dtd_entity |
| 264 | +/** |
|
| 265 | + * @param string $dtd |
|
| 266 | + */ |
|
| 249 | 267 | function analyser_dtd_entity($dtd, &$dtc, $grammaire) { |
| 250 | 268 | if (!preg_match(_REGEXP_ENTITY_DECL, $dtd, $m)) { |
| 251 | 269 | return -2; |
@@ -303,6 +321,9 @@ discard block |
||
| 303 | 321 | // Fin du controle en finElement |
| 304 | 322 | |
| 305 | 323 | // https://code.spip.net/@analyser_dtd_element |
| 324 | +/** |
|
| 325 | + * @param string $dtd |
|
| 326 | + */ |
|
| 306 | 327 | function analyser_dtd_element($dtd, &$dtc, $grammaire) { |
| 307 | 328 | if (!preg_match('/^<!ELEMENT\s+([^>\s]+)([^>]*)>\s*(.*)$/s', $dtd, $m)) { |
| 308 | 329 | return -3; |
@@ -351,6 +372,9 @@ discard block |
||
| 351 | 372 | |
| 352 | 373 | |
| 353 | 374 | // https://code.spip.net/@analyser_dtd_attlist |
| 375 | +/** |
|
| 376 | + * @param string $dtd |
|
| 377 | + */ |
|
| 354 | 378 | function analyser_dtd_attlist($dtd, &$dtc, $grammaire) { |
| 355 | 379 | if (!preg_match('/^<!ATTLIST\s+(\S+)\s+([^>]*)>\s*(.*)/s', $dtd, $m)) { |
| 356 | 380 | return -5; |
@@ -102,6 +102,9 @@ discard block |
||
| 102 | 102 | : xml_entites_html($data); |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | +/** |
|
| 106 | + * @param IndenteurXML $phraseur |
|
| 107 | + */ |
|
| 105 | 108 | function xml_piElement($phraseur, $target, $data) { |
| 106 | 109 | $depth = $phraseur->depth; |
| 107 | 110 | |
@@ -118,6 +121,9 @@ discard block |
||
| 118 | 121 | |
| 119 | 122 | |
| 120 | 123 | // https://code.spip.net/@xml_defautElement |
| 124 | +/** |
|
| 125 | + * @param IndenteurXML $phraseur |
|
| 126 | + */ |
|
| 121 | 127 | function xml_defaultElement($phraseur, $data) { |
| 122 | 128 | $depth = $phraseur->depth; |
| 123 | 129 | |
@@ -149,6 +155,9 @@ discard block |
||
| 149 | 155 | } |
| 150 | 156 | |
| 151 | 157 | // https://code.spip.net/@coordonnees_erreur |
| 158 | +/** |
|
| 159 | + * @param string $msg |
|
| 160 | + */ |
|
| 152 | 161 | function coordonnees_erreur($phraseur, $msg) { |
| 153 | 162 | $entete_length = substr_count($phraseur->entete, "\n"); |
| 154 | 163 | $phraseur->err[] = array( |
@@ -102,6 +102,10 @@ discard block |
||
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | // https://code.spip.net/@phraser_polyglotte |
| 105 | +/** |
|
| 106 | + * @param string $texte |
|
| 107 | + * @param integer $ligne |
|
| 108 | + */ |
|
| 105 | 109 | function phraser_polyglotte($texte, $ligne, $result) { |
| 106 | 110 | |
| 107 | 111 | if (preg_match_all(BALISE_POLYGLOTTE, $texte, $m, PREG_SET_ORDER)) { |
@@ -266,6 +270,9 @@ discard block |
||
| 266 | 270 | // on recommence tant qu'il y a des [...] en substituant a l'appel suivant |
| 267 | 271 | |
| 268 | 272 | // https://code.spip.net/@phraser_champs_etendus |
| 273 | +/** |
|
| 274 | + * @param integer $ligne |
|
| 275 | + */ |
|
| 269 | 276 | function phraser_champs_etendus($texte, $ligne, $result) { |
| 270 | 277 | if ($texte === "") { |
| 271 | 278 | return $result; |
@@ -314,6 +321,10 @@ discard block |
||
| 314 | 321 | } |
| 315 | 322 | |
| 316 | 323 | // https://code.spip.net/@phraser_arg |
| 324 | +/** |
|
| 325 | + * @param string $texte |
|
| 326 | + * @param string $sep |
|
| 327 | + */ |
|
| 317 | 328 | function phraser_arg(&$texte, $sep, $result, &$pointeur_champ) { |
| 318 | 329 | preg_match(",^(\|?[^}{)|]*)(.*)$,ms", $texte, $match); |
| 319 | 330 | $suite = ltrim($match[2]); |
@@ -451,6 +462,9 @@ discard block |
||
| 451 | 462 | |
| 452 | 463 | |
| 453 | 464 | // https://code.spip.net/@phraser_champs_exterieurs |
| 465 | +/** |
|
| 466 | + * @param string $texte |
|
| 467 | + */ |
|
| 454 | 468 | function phraser_champs_exterieurs($texte, $ligne, $sep, $nested) { |
| 455 | 469 | $res = array(); |
| 456 | 470 | while (($p = strpos($texte, "%$sep")) !== false) { |
@@ -470,6 +484,9 @@ discard block |
||
| 470 | 484 | } |
| 471 | 485 | |
| 472 | 486 | // https://code.spip.net/@phraser_champs_interieurs |
| 487 | +/** |
|
| 488 | + * @param string $sep |
|
| 489 | + */ |
|
| 473 | 490 | function phraser_champs_interieurs($texte, $ligne, $sep, $result) { |
| 474 | 491 | $i = 0; // en fait count($result) |
| 475 | 492 | $x = ""; |
@@ -766,6 +783,10 @@ discard block |
||
| 766 | 783 | } |
| 767 | 784 | |
| 768 | 785 | // https://code.spip.net/@phraser_critere_infixe |
| 786 | +/** |
|
| 787 | + * @param string $arg1 |
|
| 788 | + * @param string $arg2 |
|
| 789 | + */ |
|
| 769 | 790 | function phraser_critere_infixe($arg1, $arg2, $args, $op, $not, $cond) { |
| 770 | 791 | $args[0] = new Texte; |
| 771 | 792 | $args[0]->texte = $arg1; |
@@ -895,7 +916,7 @@ discard block |
||
| 895 | 916 | * @param $texte |
| 896 | 917 | * @param $id_parent |
| 897 | 918 | * @param $boucle |
| 898 | - * @param $pos_debut_texte |
|
| 919 | + * @param integer $pos_debut_texte |
|
| 899 | 920 | * @param $result |
| 900 | 921 | * @return mixed |
| 901 | 922 | */ |
@@ -412,6 +412,13 @@ |
||
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | |
| 415 | +/** |
|
| 416 | + * @param integer $id |
|
| 417 | + * @param string $type |
|
| 418 | + * @param double $n |
|
| 419 | + * @param string|null $img |
|
| 420 | + * @param string $titre |
|
| 421 | + */ |
|
| 415 | 422 | function afficher_script_statut($id, $type, $n, $img, $statut, $titre, $act = '') { |
| 416 | 423 | $h = generer_action_auteur("instituer_objet", "$type-$id-$statut"); |
| 417 | 424 | $t = supprimer_tags($titre); |